diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-07-15 17:11:21 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-07-15 17:11:21 +0000 |
commit | 19eed2939e10fdd431ae6774fde6f8dad9be4fbf (patch) | |
tree | 835c4ec0342ae26160f46143be0f96a68ea2c87c /unittests | |
parent | bfbaed9ca73cba98737766f0145ffd8c7838895b (diff) | |
download | clang-19eed2939e10fdd431ae6774fde6f8dad9be4fbf.tar.gz |
Add the ability to AST match a variable declaration that is an exception variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 8ef3f15e4c..54aed8f3fc 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/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) { |