summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorGabor Marton <martongabesz@gmail.com>2018-05-30 09:19:26 +0000
committerGabor Marton <martongabesz@gmail.com>2018-05-30 09:19:26 +0000
commita0df7a9a4d3b7f51400ad66d971121333766adc1 (patch)
tree2bfa380366ac55735703eb6813e0571daa0f0f07 /clang/lib
parent42e671d73df94f9548094a3f1e296b3ecf111de9 (diff)
downloadbcm5719-llvm-a0df7a9a4d3b7f51400ad66d971121333766adc1.tar.gz
bcm5719-llvm-a0df7a9a4d3b7f51400ad66d971121333766adc1.zip
[ASTImporter] Corrected lookup at import of templated record decl
Summary: When a CXXRecordDecl under ClassTemplateDecl is imported, check the templated record decl for similarity instead of the template. Reviewers: a.sidorin Reviewed By: a.sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D47313 Patch by Balazs Keri! llvm-svn: 333522
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTImporter.cpp9
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
OpenPOWER on IntegriCloud