]> granicus.if.org Git - clang/commitdiff
[AST] Fix for structural equivalence tests in rL336776.
authorBalazs Keri <1.int32@gmail.com>
Wed, 11 Jul 2018 15:26:26 +0000 (15:26 +0000)
committerBalazs Keri <1.int32@gmail.com>
Wed, 11 Jul 2018 15:26:26 +0000 (15:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336817 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/AST/StructuralEquivalenceTest.cpp

index 16998f2420acdfc0f5eabb42e163f5bf67477eae..df37b722633e44fcabc732936c411c46f7a74f7f 100644 (file)
@@ -404,14 +404,14 @@ TEST_F(StructuralEquivalenceCXXMethodTest, Delete) {
 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(StructuralEquivalenceCXXMethodTest, ConstructorExplicit) {
   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(StructuralEquivalenceCXXMethodTest, ConstructorDefault) {
   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, Name) {
       "struct A{ };",
       "struct B{ };",
       Lang_CXX,
-      cxxRecordDecl());
+      cxxRecordDecl(hasName("A")),
+      cxxRecordDecl(hasName("B")));
   EXPECT_FALSE(testStructuralMatch(t));
 }