[PATCH] D112491: Add `LambdaCapture`-related matchers.

James King via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 29 12:16:47 PDT 2021


jcking1034 added inline comments.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4652
+///   matches `[this]() { return cc; }`.
+AST_MATCHER(LambdaCapture, refersToThis) { return Node.capturesThis(); }
+
----------------
sammccall wrote:
> Again, why `refersToThis` rather than `capturesThis`, which is more specific and matches the AST?
Initially, I think I saw that there were a few `TemplateArgument` matchers of the form `refersToX`, so I wanted to maintain some consistency with that. But I think I your suggestion makes things clearer, so will opt for that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112491/new/

https://reviews.llvm.org/D112491



More information about the cfe-commits mailing list