summaryrefslogtreecommitdiffstats
path: root/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-07-02 14:02:41 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-07-02 14:02:41 +0000
commit8f4699a8c6f5c95ac294d83fcc84e394082b3733 (patch)
tree6c539c4389533cbf36d5c82a1570e15a3a288711 /clang/lib/ASTMatchers/ASTMatchersInternal.cpp
parent55c384e039ebe1b6fb2e965cccb5f8e4217fbc98 (diff)
downloadbcm5719-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/lib/ASTMatchers/ASTMatchersInternal.cpp')
-rw-r--r--clang/lib/ASTMatchers/ASTMatchersInternal.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index 2c482e38dc0..b6ef8226a9a 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -114,9 +114,9 @@ DynTypedMatcher DynTypedMatcher::constructVariadic(
assert(InnerMatchers.size() > 0 && "Array must not be empty.");
assert(std::all_of(InnerMatchers.begin(), InnerMatchers.end(),
[&InnerMatchers](const DynTypedMatcher &M) {
- return InnerMatchers[0].SupportedKind.isSame(M.SupportedKind);
+ return InnerMatchers[0].canConvertTo(M.SupportedKind);
}) &&
- "SupportedKind must match!");
+ "SupportedKind must be convertible to a common type!");
auto SupportedKind = InnerMatchers[0].SupportedKind;
// We must relax the restrict kind here.
OpenPOWER on IntegriCloud