diff options
Diffstat (limited to 'clang/lib/AST/ASTImporter.cpp')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index d64b64ce43b..f812244ed3c 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2015,7 +2015,14 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { if (const auto *Tag = Typedef->getUnderlyingType()->getAs<TagType>()) Found = Tag->getDecl(); } - + + if (D->getDescribedTemplate()) { + if (auto *Template = dyn_cast<ClassTemplateDecl>(Found)) + Found = Template->getTemplatedDecl(); + else + continue; + } + if (auto *FoundRecord = dyn_cast<RecordDecl>(Found)) { if (!SearchName) { // If both unnamed structs/unions are in a record context, make sure |