operator()(const Matcher<T> &InnerMatcher) const {
return create(InnerMatcher);
}
+
+ template <typename... T>
+ ArgumentAdaptingMatcherFuncAdaptor<ArgumentAdapterT,
+ typename GetClade<T...>::Type, ToTypes>
+ operator()(const MapAnyOfHelper<T...> &InnerMatcher) const {
+ return create(InnerMatcher.with());
+ }
};
template <typename T> class TraversalMatcher : public MatcherInterface<T> {
Code, traverse(TK_IgnoreUnlessSpelledInSource,
mapAnyOf(ifStmt, forStmt).with(hasCondition(falseExpr)))));
+ EXPECT_TRUE(
+ matches(Code, cxxBoolLiteral(equals(true),
+ hasAncestor(mapAnyOf(ifStmt, forStmt)))));
+
+ EXPECT_TRUE(
+ matches(Code, cxxBoolLiteral(equals(false),
+ hasAncestor(mapAnyOf(ifStmt, forStmt)))));
+
+ EXPECT_TRUE(
+ notMatches(Code, floatLiteral(hasAncestor(mapAnyOf(ifStmt, forStmt)))));
+
Code = R"cpp(
void func(bool b) {}
struct S {