auto Matcher = varDecl(hasInitializer(floatLiteral()));
EXPECT_TRUE(notMatches(VarDeclCode, traverse(TK_AsIs, Matcher)));
- EXPECT_TRUE(matches(VarDeclCode,
- traverse(TK_IgnoreImplicitCastsAndParentheses, Matcher)));
+ EXPECT_TRUE(
+ matches(VarDeclCode, traverse(TK_IgnoreUnlessSpelledInSource, Matcher)));
auto ParentMatcher = floatLiteral(hasParent(varDecl(hasName("i"))));
)cpp";
EXPECT_TRUE(
- matches(Code, traverse(TK_IgnoreImplicitCastsAndParentheses,
+ matches(Code, traverse(TK_IgnoreUnlessSpelledInSource,
callExpr(has(callExpr(traverse(
TK_AsIs, callExpr(has(implicitCastExpr(
has(floatLiteral())))))))))));
EXPECT_TRUE(matches(
Code,
- traverse(TK_IgnoreImplicitCastsAndParentheses,
+ traverse(TK_IgnoreUnlessSpelledInSource,
traverse(TK_AsIs, implicitCastExpr(has(floatLiteral()))))));
}
}
)cpp";
- auto Matcher =
- traverse(TK_IgnoreImplicitCastsAndParentheses, implicitCastExpr());
+ auto Matcher = traverse(TK_IgnoreUnlessSpelledInSource, implicitCastExpr());
// Verfiy that it does not segfault
EXPECT_FALSE(matches(Code, Matcher));
EXPECT_TRUE(matches(
Code,
functionDecl(anyOf(hasDescendant(Matcher),
- traverse(TK_IgnoreImplicitCastsAndParentheses,
+ traverse(TK_IgnoreUnlessSpelledInSource,
functionDecl(hasDescendant(Matcher)))))));
}