aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2016-09-26 17:04:27 +0000
committerAaron Ballman <aaron@aaronballman.com>2016-09-26 17:04:27 +0000
commit5fa302cb65dd45743d9b5af26ca21500e8418bf2 (patch)
tree20d051da7a65cf77ecfcf2a41af84bc1a9f33156 /clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
parentb3d2546c43ac3ebdfa807ab0db2ab83ecf989216 (diff)
downloadllvm-5fa302cb65dd45743d9b5af26ca21500e8418bf2.zip
llvm-5fa302cb65dd45743d9b5af26ca21500e8418bf2.tar.gz
llvm-5fa302cb65dd45743d9b5af26ca21500e8418bf2.tar.bz2
Complete support for the cxxCtorInitializer() AST matcher so that it can be used as a top-level matcher.
llvm-svn: 282417
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
index 6c8a5e0..a981e10 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
@@ -528,6 +528,11 @@ TEST(Matcher, ConstructorCall) {
EXPECT_TRUE(matches("class X {}; void x(int) { X x; }", Constructor));
}
+TEST(Match, ConstructorInitializers) {
+ EXPECT_TRUE(matches("class C { int i; public: C(int ii) : i(ii) {} };",
+ cxxCtorInitializer(forField(hasName("i")))));
+}
+
TEST(Matcher, ThisExpr) {
EXPECT_TRUE(
matches("struct X { int a; int f () { return a; } };", cxxThisExpr()));