[PATCH] D102213: [ASTMatchers] Add forCallable(), a generalization of forFunction().
Stephen Kelly via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 11 02:24:42 PDT 2021
steveire added a comment.
I'm not certain what strong opinions I've voiced on the mailing list about that. Was it just that I think `hasDescendant` can lead to unexpected matches and a more-specific matcher should always be used when available (such as `hasArgument`)? I do think `has`, `hasDescendant`, `hasAncestor` etc have their uses and they get more useful with utilities like `forFunction`.
I don't know anything about objc. Is it possible to have callable decls nested within each other, like in c++? Is it common? `forFunction` is mostly useful for the very common case of lambdas within functions.
Does it make sense to add an overload for `LambdaExpr` so that you can write `forCallable(lambdaExpr())`?
Is there a missing test for `forFunction(functionDecl())`?
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102213/new/
https://reviews.llvm.org/D102213
More information about the cfe-commits
mailing list