summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTImporter.cpp
diff options
context:
space:
mode:
authorGabor Marton <martongabesz@gmail.com>2018-07-05 09:51:13 +0000
committerGabor Marton <martongabesz@gmail.com>2018-07-05 09:51:13 +0000
commit0bebf9594440424ee722b78ca45e97907c4c353b (patch)
treec387dab735c2e075cd8a116490c55b960560aaa5 /clang/lib/AST/ASTImporter.cpp
parent6dc45e6ca07781aba05009713731175d7bcaa47d (diff)
downloadbcm5719-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.cpp13
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;
OpenPOWER on IntegriCloud