[PATCH] D59692: [ASTImporter] Fix name conflict handling

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 24 09:13:13 PDT 2019


a_sidorin added a comment.

Hi Gabor,

Thank you for addressing the problem!



================
Comment at: lib/AST/ASTImporter.cpp:2256
             return Importer.MapImported(D, FoundTypedef);
-        }
-        // FIXME Handle redecl chain.
-        break;
+        } else
+          ConflictingDecls.push_back(FoundDecl);
----------------
`if` body is surrounded by braces, so it's better to surround `else` too.


================
Comment at: lib/AST/ASTImporter.cpp:2260
 
       ConflictingDecls.push_back(FoundDecl);
     }
----------------
Do we push the same decl twice?


================
Comment at: lib/AST/ASTImporter.cpp:8532
                                                 unsigned NumDecls) {
-  return Name;
+  return DeclarationName();
 }
----------------
Empty DeclarationName can be valid sometimes. Should we return ErrorOr<DeclarationName> instead? This can also simplify caller code a bit.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59692/new/

https://reviews.llvm.org/D59692





More information about the cfe-commits mailing list