r336817 - [AST] Fix for structural equivalence tests in rL336776.

Balazs Keri via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 11 08:26:26 PDT 2018


Author: balazske
Date: Wed Jul 11 08:26:26 2018
New Revision: 336817

URL: http://llvm.org/viewvc/llvm-project?rev=336817&view=rev
Log:
[AST] Fix for structural equivalence tests in rL336776.

Modified:
    cfe/trunk/unittests/AST/StructuralEquivalenceTest.cpp

Modified: cfe/trunk/unittests/AST/StructuralEquivalenceTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/AST/StructuralEquivalenceTest.cpp?rev=336817&r1=336816&r2=336817&view=diff
==============================================================================
--- cfe/trunk/unittests/AST/StructuralEquivalenceTest.cpp (original)
+++ cfe/trunk/unittests/AST/StructuralEquivalenceTest.cpp Wed Jul 11 08:26:26 2018
@@ -404,14 +404,14 @@ TEST_F(StructuralEquivalenceCXXMethodTes
 TEST_F(StructuralEquivalenceCXXMethodTest, Constructor) {
   auto t = makeDecls<FunctionDecl>(
       "void foo();", "struct foo { foo(); };", Lang_CXX,
-      functionDecl(), cxxConstructorDecl());
+      functionDecl(hasName("foo")), cxxConstructorDecl(hasName("foo")));
   EXPECT_FALSE(testStructuralMatch(t));
 }
 
 TEST_F(StructuralEquivalenceCXXMethodTest, ConstructorParam) {
   auto t = makeDecls<CXXConstructorDecl>("struct X { X(); };",
                                          "struct X { X(int); };", Lang_CXX,
-                                         cxxConstructorDecl());
+                                         cxxConstructorDecl(hasName("X")));
   EXPECT_FALSE(testStructuralMatch(t));
 }
 
@@ -419,7 +419,7 @@ TEST_F(StructuralEquivalenceCXXMethodTes
   auto t = makeDecls<CXXConstructorDecl>("struct X { X(int); };",
                                          "struct X { explicit X(int); };",
                                          Lang_CXX11,
-                                         cxxConstructorDecl());
+                                         cxxConstructorDecl(hasName("X")));
   EXPECT_FALSE(testStructuralMatch(t));
 }
 
@@ -427,7 +427,7 @@ TEST_F(StructuralEquivalenceCXXMethodTes
   auto t = makeDecls<CXXConstructorDecl>("struct X { X(); };",
                                          "struct X { X() = default; };",
                                          Lang_CXX11,
-                                         cxxConstructorDecl());
+                                         cxxConstructorDecl(hasName("X")));
   EXPECT_FALSE(testStructuralMatch(t));
 }
 
@@ -474,7 +474,8 @@ TEST_F(StructuralEquivalenceRecordTest,
       "struct A{ };",
       "struct B{ };",
       Lang_CXX,
-      cxxRecordDecl());
+      cxxRecordDecl(hasName("A")),
+      cxxRecordDecl(hasName("B")));
   EXPECT_FALSE(testStructuralMatch(t));
 }
 




More information about the cfe-commits mailing list