summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-02-06 21:52:24 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-02-06 21:52:24 +0000
commit1fec3dfe430f1cb202df439ddc1e166248c2df0e (patch)
tree6962077f893b686607a6c08ecafda13b95299d22 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp
parent3d584b0ced408acd5cdb6a73d3dff568844b260f (diff)
downloadbcm5719-llvm-1fec3dfe430f1cb202df439ddc1e166248c2df0e.tar.gz
bcm5719-llvm-1fec3dfe430f1cb202df439ddc1e166248c2df0e.zip
Add isListInitialization matcher.
Differential Revision: http://llvm-reviews.chandlerc.com/D2708 llvm-svn: 200949
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 8825174c499..5c9753f9336 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -1637,6 +1637,17 @@ TEST(Matcher, ConstructorArgumentCount) {
Constructor1Arg));
}
+TEST(Matcher, ConstructorListInitialization) {
+ StatementMatcher ConstructorListInit = constructExpr(isListInitialization());
+
+ EXPECT_TRUE(
+ matches("class X { public: X(int); }; void x() { X x{0}; }",
+ ConstructorListInit));
+ EXPECT_FALSE(
+ matches("class X { public: X(int); }; void x() { X x(0); }",
+ ConstructorListInit));
+}
+
TEST(Matcher,ThisExpr) {
EXPECT_TRUE(
matches("struct X { int a; int f () { return a; } };", thisExpr()));
OpenPOWER on IntegriCloud