From: Manuel Klimek Date: Wed, 27 Feb 2013 11:56:58 +0000 (+0000) Subject: Make the negative test of recordType depend on a specific record. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0cc798f29d489140dd81b558e9c052e9a83cce39;p=clang Make the negative test of recordType depend on a specific record. Otherwise it'll break if there's a record type in the AST by default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176181 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 565c356235..53620a0294 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -3436,8 +3436,10 @@ TEST(TypeMatching, MatchesTemplateSpecializationType) { TEST(TypeMatching, MatchesRecordType) { EXPECT_TRUE(matches("class C{}; C c;", recordType())); - EXPECT_TRUE(matches("struct S{}; S s;", recordType())); - EXPECT_TRUE(notMatches("int i;", recordType())); + EXPECT_TRUE(matches("struct S{}; S s;", + recordType(hasDeclaration(recordDecl(hasName("S")))))); + EXPECT_TRUE(notMatches("int i;", + recordType(hasDeclaration(recordDecl(hasName("S")))))); } TEST(TypeMatching, MatchesElaboratedType) {