[PATCH] D49296: [ASTImporter] Fix import of unnamed structs

Aleksei Sidorin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 14 23:18:32 PDT 2018


a_sidorin added a comment.

Hi Gabor,
The change is OK but I have some questions regarding tests.



================
Comment at: unittests/AST/ASTImporterTest.cpp:2495
+      FirstDeclMatcher<FieldDecl>().match(ToTU, fieldDecl(hasName("entry1")));
+  auto getRecordDecl = [](FieldDecl *FD) {
+    auto *ET = cast<ElaboratedType>(FD->getType().getTypePtr());
----------------
There is already a similar lambda definitions for `getRecordDecl()` in ObjectsWithUnnamedStructType test. Can we make it a function, like it is done for StructuralEquivalenceContext?


================
Comment at: unittests/AST/StructuralEquivalenceTest.cpp:581
+  ASSERT_NE(R0, R1);
+  EXPECT_TRUE(testStructuralMatch(R0, R0));
+  EXPECT_TRUE(testStructuralMatch(R1, R1));
----------------
Do we really want to test the equivalence of decl to itself, not to its imported version?


Repository:
  rC Clang

https://reviews.llvm.org/D49296





More information about the cfe-commits mailing list