File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments