summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-07-15 17:11:21 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-07-15 17:11:21 +0000
commit3991846c33a21c4bb9e2a3edc4d978d7a95c1092 (patch)
treed7c96064bc821cb64ec6f8b46b033ab93be04b6b /clang/unittests/ASTMatchers/ASTMatchersTest.cpp
parentee5feafc0f467102cd12e8be82b54cc23158beb1 (diff)
downloadbcm5719-llvm-3991846c33a21c4bb9e2a3edc4d978d7a95c1092.tar.gz
bcm5719-llvm-3991846c33a21c4bb9e2a3edc4d978d7a95c1092.zip
Add the ability to AST match a variable declaration that is an exception variable.
llvm-svn: 242303
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 8ef3f15e4c0..54aed8f3fc1 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -3329,6 +3329,10 @@ TEST(ExceptionHandling, SimpleCases) {
catchStmt(isCatchAll())));
EXPECT_TRUE(notMatches("void foo() try { throw; } catch(int) { }",
catchStmt(isCatchAll())));
+ EXPECT_TRUE(matches("void foo() try {} catch(int X) { }",
+ varDecl(isExceptionVariable())));
+ EXPECT_TRUE(notMatches("void foo() try { int X; } catch (...) { }",
+ varDecl(isExceptionVariable())));
}
TEST(HasConditionVariableStatement, DoesNotMatchCondition) {
OpenPOWER on IntegriCloud