summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-02-27 11:56:58 +0000
committerManuel Klimek <klimek@google.com>2013-02-27 11:56:58 +0000
commit59b0af6381c9cbbc1e97888633a5368804ed0566 (patch)
tree8adbc0de72591ab19daa3aa17fe9099432c6bf75 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp
parent8e55927153da2b4ace252cacf51c38a70d5d9aa0 (diff)
downloadbcm5719-llvm-59b0af6381c9cbbc1e97888633a5368804ed0566.tar.gz
bcm5719-llvm-59b0af6381c9cbbc1e97888633a5368804ed0566.zip
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. llvm-svn: 176181
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 565c356235f..53620a02942 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud