forked from OSchip/llvm-project
Match code following lambdas when ignoring invisible nodes
Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71976
This commit is contained in:
parent
df3b56c905
commit
d89c4cb938
|
@ -248,7 +248,7 @@ public:
|
|||
if (!match(*Node->getBody()))
|
||||
return false;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool shouldVisitTemplateInstantiations() const { return true; }
|
||||
|
|
|
@ -1760,6 +1760,7 @@ void func13() {
|
|||
|
||||
void func14() {
|
||||
[] <typename TemplateType> (TemplateType t, TemplateType u) { int e = t + u; };
|
||||
float i = 42.0;
|
||||
}
|
||||
|
||||
)cpp";
|
||||
|
@ -1849,6 +1850,11 @@ void func14() {
|
|||
lambdaExpr(
|
||||
forFunction(functionDecl(hasName("func14"))),
|
||||
has(templateTypeParmDecl(hasName("TemplateType")))))));
|
||||
|
||||
EXPECT_TRUE(
|
||||
matches(Code, traverse(ast_type_traits::TK_IgnoreUnlessSpelledInSource,
|
||||
functionDecl(hasName("func14"),
|
||||
hasDescendant(floatLiteral())))));
|
||||
}
|
||||
|
||||
TEST(IgnoringImpCasts, MatchesImpCasts) {
|
||||
|
|
Loading…
Reference in New Issue