diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-07-02 14:02:41 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-07-02 14:02:41 +0000 |
commit | 67f1fc17581bbab997d728668d26f01399cc01eb (patch) | |
tree | 5c507bba49ec522c902179f2a030fff06c5988ef /unittests | |
parent | 5c1b5f8d06ddedb5154ef7ff51b6238ebf4489ff (diff) | |
download | clang-67f1fc17581bbab997d728668d26f01399cc01eb.tar.gz |
When testing for anyOf(), the test should not be for an exact type match for all members of the set. Instead, test that all members are convertible to the common type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241263 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 1fc7979bd0..8ef3f15e4c 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -482,6 +482,10 @@ TEST(DeclarationMatcher, MatchAnyOf) { EXPECT_TRUE(matches("int F() { return 1 + 2; }", MixedTypes)); EXPECT_TRUE(matches("int F() { if (true) return 1; }", MixedTypes)); EXPECT_TRUE(notMatches("int F() { return 1; }", MixedTypes)); + + EXPECT_TRUE( + matches("void f() try { } catch (int) { } catch (...) { }", + catchStmt(anyOf(hasDescendant(varDecl()), isCatchAll())))); } TEST(DeclarationMatcher, MatchHas) { |