diff options
| author | Samuel Benzaquen <sbenza@google.com> | 2015-07-17 16:05:27 +0000 |
|---|---|---|
| committer | Samuel Benzaquen <sbenza@google.com> | 2015-07-17 16:05:27 +0000 |
| commit | b063f5c7e173a02d7eaa39387ed8f06c2026a70b (patch) | |
| tree | 1a167bda028c3f7faa4bb12bc228a038cca0e3ea /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
| parent | 2bec8500ef9f558d9bc61ec90d4a4f64625e86dc (diff) | |
| download | bcm5719-llvm-b063f5c7e173a02d7eaa39387ed8f06c2026a70b.tar.gz bcm5719-llvm-b063f5c7e173a02d7eaa39387ed8f06c2026a70b.zip | |
[ASTMatchers] Use provided target NodeKind instead of inferring it from the matchers.
Individual matchers might not be convertible to each other's kind, but
they might still all be convertible to the target kind.
All the callers already know the target kind, so just pass it down.
llvm-svn: 242534
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 54aed8f3fc1..5ac28e5d3e0 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -453,6 +453,16 @@ TEST(AllOf, AllOverloadsWork) { hasArgument(3, integerLiteral(equals(4))))))); } +TEST(ConstructVariadic, MismatchedTypes_Regression) { + EXPECT_TRUE( + matches("const int a = 0;", + internal::DynTypedMatcher::constructVariadic( + internal::DynTypedMatcher::VO_AnyOf, + ast_type_traits::ASTNodeKind::getFromNodeKind<QualType>(), + {isConstQualified(), arrayType()}) + .convertTo<QualType>())); +} + TEST(DeclarationMatcher, MatchAnyOf) { DeclarationMatcher YOrZDerivedFromX = recordDecl(anyOf(hasName("Y"), allOf(isDerivedFrom("X"), hasName("Z")))); |

