[PATCH] D56936: Fix handling of overriden methods during ASTImport

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 22 05:47:42 PST 2019


martong added a comment.

I have found some other minor things in the tests.



================
Comment at: unittests/AST/ASTImporterTest.cpp:2275
+  auto DFDef = cxxMethodDecl(
+      hasName("f"), hasParent(cxxRecordDecl(hasName("B"))), isDefinition());
+  auto FDefAll = cxxMethodDecl(hasName("f"), isDefinition());
----------------
I think the parent should have `hasName("D")` here. Seems like a copy paste error.


================
Comment at: unittests/AST/ASTImporterTest.cpp:2282
+    auto *FromD = FirstDeclMatcher<CXXMethodDecl>().match(FromTU, DP);
+    ImportedD = Import(FromD, Lang_CXX);
+  }
----------------
`ImportedD` seems to be unused. (And in the next test case too.)


================
Comment at: unittests/AST/ASTImporterTest.cpp:2400
+
+  // Check that the redecl chain is intact.
+  EXPECT_EQ(ToBFOutOfClass->getPreviousDecl(), ToBFInClass);
----------------
Could we check the redecl chain of `D::f()` too?


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

https://reviews.llvm.org/D56936





More information about the cfe-commits mailing list