diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2016-01-20 16:17:39 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2016-01-20 16:17:39 +0000 |
commit | 649afe2db602c304d6e5a51e2e21e011fc961953 (patch) | |
tree | 574b5e1b05d00f8e4d030377723d9fe6c77cc33a /unittests/ASTMatchers/Dynamic | |
parent | 5944d95c2c79632face71a22e90d2aab053b4cb4 (diff) |
Add AST matcher for paren expressions.
Patch by Adrian ZgorzaĆek.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/Dynamic')
-rw-r--r-- | unittests/ASTMatchers/Dynamic/RegistryTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/Dynamic/RegistryTest.cpp b/unittests/ASTMatchers/Dynamic/RegistryTest.cpp index 8e97566f69..a1b6a93456 100644 --- a/unittests/ASTMatchers/Dynamic/RegistryTest.cpp +++ b/unittests/ASTMatchers/Dynamic/RegistryTest.cpp @@ -506,6 +506,12 @@ TEST_F(RegistryTest, HasArgs) { EXPECT_FALSE(matches("struct X {};", Value)); } +TEST_F(RegistryTest, ParenExpr) { + Matcher<Stmt> Value = constructMatcher("parenExpr").getTypedMatcher<Stmt>(); + EXPECT_TRUE(matches("int i = (1);", Value)); + EXPECT_FALSE(matches("int i = 1;", Value)); +} + } // end anonymous namespace } // end namespace dynamic } // end namespace ast_matchers |