Skip to content

Commit 4109a51

Browse files
committed
fix test
1 parent 7656902 commit 4109a51

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/lib/AST/ASTImporter.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6731,6 +6731,13 @@ ASTNodeImporter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {
67316731
if (Error Err = importInto(TemplatedFD, D->getTemplatedDecl()))
67326732
return std::move(Err);
67336733

6734+
// Fail if TemplatedFD is already part of a template.
6735+
// The structural equivalence check should have been found this template.
6736+
// If not, there is AST incompatibility that can be caused by previous import
6737+
// errors.
6738+
if (TemplatedFD->getDescribedTemplate())
6739+
return make_error<ASTImportError>(ASTImportError::NameConflict);
6740+
67346741
// At creation of the template the template parameters are "adopted"
67356742
// (DeclContext is changed). After this possible change the lookup table
67366743
// must be updated.

0 commit comments

Comments
 (0)