summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTStructuralEquivalence.cpp
diff options
context:
space:
mode:
authorGabor Marton <martongabesz@gmail.com>2018-07-17 12:06:36 +0000
committerGabor Marton <martongabesz@gmail.com>2018-07-17 12:06:36 +0000
commitf086fa8443bf3676cd31e2bcd6a97691edb01007 (patch)
tree5646895fa202fde1ed67465cd1b2726f6561cd11 /clang/lib/AST/ASTStructuralEquivalence.cpp
parentda4302ce0d4652f36b966d4dfabb1556c53bf5ce (diff)
downloadbcm5719-llvm-f086fa8443bf3676cd31e2bcd6a97691edb01007.tar.gz
bcm5719-llvm-f086fa8443bf3676cd31e2bcd6a97691edb01007.zip
[ASTImporter] Fix import of unnamed structs
Summary: D48773 simplified ASTImporter nicely, but it introduced a new error: Unnamed structs are not imported correctly, if they appear in a recursive context. This patch provides a fix for structural equivalency. Reviewers: a.sidorin, a_sidorin, balazske, gerazo Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D49296 llvm-svn: 337267
Diffstat (limited to 'clang/lib/AST/ASTStructuralEquivalence.cpp')
-rw-r--r--clang/lib/AST/ASTStructuralEquivalence.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp
index 77e0d9e61bd..1da7b849487 100644
--- a/clang/lib/AST/ASTStructuralEquivalence.cpp
+++ b/clang/lib/AST/ASTStructuralEquivalence.cpp
@@ -924,7 +924,7 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
return false;
}
- if (D1->isAnonymousStructOrUnion() && D2->isAnonymousStructOrUnion()) {
+ if (!D1->getDeclName() && !D2->getDeclName()) {
// If both anonymous structs/unions are in a record context, make sure
// they occur in the same location in the context records.
if (Optional<unsigned> Index1 =
OpenPOWER on IntegriCloud