// Sadly, we can't check whether the literal has suffix or not.
// E.g. i32 suffix still results in 'BuiltinType::Kind::Int'.
// And such an info is not stored in the *Literal itself.
- Finder->addMatcher(
+ Finder->addMatcher(traverse(TK_AsIs,
stmt(eachOf(integerLiteral().bind(IntegerLiteralCheck::Name),
floatLiteral().bind(FloatingLiteralCheck::Name)),
unless(anyOf(hasParent(userDefinedLiteral()),
hasAncestor(isImplicit()),
- hasAncestor(substNonTypeTemplateParmExpr())))),
+ hasAncestor(substNonTypeTemplateParmExpr()))))),
this);
}
Expr *LastE = nullptr;
while (E != LastE) {
LastE = E;
- E = IgnoreExprNodes(E, IgnoreImplicitSingleStep, IgnoreImpCastsSingleStep,
+ E = IgnoreExprNodes(E, IgnoreImplicitSingleStep, IgnoreImpCastsExtraSingleStep,
IgnoreParensOnlySingleStep);
auto SR = E->getSourceRange();
EXPECT_FALSE(matches("template<int N>\n"
"struct A { static const int n = 0; };\n"
"struct B : public A<42> {};",
- substNonTypeTemplateParmExpr()));
+ traverse(TK_AsIs,
+ substNonTypeTemplateParmExpr())));
EXPECT_TRUE(matches("template<int N>\n"
"struct A { static const int n = N; };\n"
"struct B : public A<42> {};",
- substNonTypeTemplateParmExpr()));
+ traverse(TK_AsIs,
+ substNonTypeTemplateParmExpr())));
}
TEST(Matcher, NonTypeTemplateParmDecl) {