diff options
author | Gabor Marton <martongabesz@gmail.com> | 2018-07-05 09:51:13 +0000 |
---|---|---|
committer | Gabor Marton <martongabesz@gmail.com> | 2018-07-05 09:51:13 +0000 |
commit | 0bebf9594440424ee722b78ca45e97907c4c353b (patch) | |
tree | c387dab735c2e075cd8a116490c55b960560aaa5 /clang/lib/AST/ASTImporter.cpp | |
parent | 6dc45e6ca07781aba05009713731175d7bcaa47d (diff) | |
download | bcm5719-llvm-0bebf9594440424ee722b78ca45e97907c4c353b.tar.gz bcm5719-llvm-0bebf9594440424ee722b78ca45e97907c4c353b.zip |
[ASTImporter] Fix import of objects with anonymous types
Summary:
Currently, anonymous types are merged into the same redecl chain even if they
are structurally inequivalent. This results that global objects are not
imported, if there are at least two global objects with different anonymous
types. This patch provides a fix.
Reviewers: a.sidorin, balazske, r.stahl
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D48773
llvm-svn: 336332
Diffstat (limited to 'clang/lib/AST/ASTImporter.cpp')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index bc75d80a554..759f9da30bf 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2072,17 +2072,8 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { if (auto *FoundRecord = dyn_cast<RecordDecl>(Found)) { if (!SearchName) { - // If both unnamed structs/unions are in a record context, make sure - // they occur in the same location in the context records. - if (Optional<unsigned> Index1 = - StructuralEquivalenceContext::findUntaggedStructOrUnionIndex( - D)) { - if (Optional<unsigned> Index2 = StructuralEquivalenceContext:: - findUntaggedStructOrUnionIndex(FoundRecord)) { - if (*Index1 != *Index2) - continue; - } - } + if (!IsStructuralMatch(D, FoundRecord, false)) + continue; } PrevDecl = FoundRecord; |