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 | 8f4699a8c6f5c95ac294d83fcc84e394082b3733 (patch) | |
| tree | 6c539c4389533cbf36d5c82a1570e15a3a288711 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
| parent | 55c384e039ebe1b6fb2e965cccb5f8e4217fbc98 (diff) | |
| download | bcm5719-llvm-8f4699a8c6f5c95ac294d83fcc84e394082b3733.tar.gz bcm5719-llvm-8f4699a8c6f5c95ac294d83fcc84e394082b3733.zip | |
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.
llvm-svn: 241263
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 1fc7979bd07..8ef3f15e4c0 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/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) { |

