summaryrefslogtreecommitdiffstats
path: root/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2017-03-28 12:56:47 +0000
committerEric Liu <ioeric@google.com>2017-03-28 12:56:47 +0000
commit54a8f5f00ec601038e1fb67c1f480a75f6a95707 (patch)
treecb18d61e5512d2d3399f10d166f7efc6c3bf385e /unittests/ASTMatchers/ASTMatchersNodeTest.cpp
parent121956bde3695cafabb07a61866ad2432fb31ae9 (diff)
[ASTMatchers] add typeAliasTemplateDecl matcher.
Reviewers: hokein, aaron.ballman Reviewed By: aaron.ballman Subscribers: aaron.ballman, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D28671 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersNodeTest.cpp')
-rw-r--r--unittests/ASTMatchers/ASTMatchersNodeTest.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index 4c13acfaf0..5c29334222 100644
--- a/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -1494,6 +1494,22 @@ TEST(TypedefNameDeclMatcher, Match) {
typedefNameDecl(hasName("typedefNameDeclTest2"))));
}
+TEST(TypeAliasTemplateDeclMatcher, Match) {
+ std::string Code = R"(
+ template <typename T>
+ class X { T t; };
+
+ template <typename T>
+ using typeAliasTemplateDecl = X<T>;
+
+ using typeAliasDecl = X<int>;
+ )";
+ EXPECT_TRUE(
+ matches(Code, typeAliasTemplateDecl(hasName("typeAliasTemplateDecl"))));
+ EXPECT_TRUE(
+ notMatches(Code, typeAliasTemplateDecl(hasName("typeAliasDecl"))));
+}
+
TEST(ObjCMessageExprMatcher, SimpleExprs) {
// don't find ObjCMessageExpr where none are present
EXPECT_TRUE(notMatchesObjC("", objcMessageExpr(anything())));