[PATCH] D47532: [ASTImporter] Import the whole redecl chain of functions

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 31 05:35:57 PDT 2018


balazske added inline comments.


================
Comment at: lib/AST/ASTImporter.cpp:88
+  llvm::SmallVector<Decl*, 2> getCanonicalForwardRedeclChain(Decl* D) {
+    // Currently only FunctionDecl is supported
+    auto FD = cast<FunctionDecl>(D);
----------------
Assert for FunctionDecl?


================
Comment at: unittests/AST/ASTImporterTest.cpp:1745
+TEST_P(ImportFunctions, ImportDefinitions) {
+  auto Pattern = functionDecl(hasName("f"));
+
----------------
This test imports the definition two times, the second should result in error. The import does not check the function body for similarness. Probably a check can be made for the result of the second import.


Repository:
  rC Clang

https://reviews.llvm.org/D47532





More information about the cfe-commits mailing list