diff options
author | Daniel Jasper <djasper@google.com> | 2012-09-29 15:55:18 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-09-29 15:55:18 +0000 |
commit | aaa8e45b8e392a1f1b7498e2f00c6ed66d41119a (patch) | |
tree | f3a6f4e6fa0a51f082389a0c523fe7219e1f78a8 /unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | 1952354bd376062c3ab3d328c0fc6c36530c9309 (diff) |
Fix refersToDeclaration()-matcher and add missing test case. This was
broken as of r164656 as TemplateArgument::getAsDecl() now asserts
instead of returning NULL for other template arugment kinds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 69e61f296f..b49d082501 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -1236,6 +1236,12 @@ TEST(Matcher, MatchesDeclarationReferenceTemplateArgument) { "A<&B::next> a;", classTemplateSpecializationDecl(hasAnyTemplateArgument( refersToDeclaration(fieldDecl(hasName("next"))))))); + + EXPECT_TRUE(notMatches( + "template <typename T> struct A {};" + "A<int> a;", + classTemplateSpecializationDecl(hasAnyTemplateArgument( + refersToDeclaration(decl()))))); } TEST(Matcher, MatchesSpecificArgument) { |