[PATCH] D39886: [ASTImporter] Fix wrong conflict detections for unnamed structures

Takafumi Kubota via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 04:34:32 PST 2017


tk1012 added a comment.





================
Comment at: lib/AST/ASTImporter.cpp:1634
   RecordDecl *PrevDecl = nullptr;
-  if (!DC->isFunctionOrMethod()) {
+  if (!DC->isFunctionOrMethod() && SearchName.getAsString() != "") {
     SmallVector<NamedDecl *, 4> ConflictingDecls;
----------------
According to include/clang/AST/Decl.h file, we cannot use "RecordDecl::isAnonymousStructOrUnion()" here because "struct { int a; } A;" is not an anonymous struct but is unnamed.


https://reviews.llvm.org/D39886





More information about the cfe-commits mailing list