[PATCH] D113575: Add `isInitCapture` and `forEachLambdaCapture` matchers.

Matt Kulukundis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 10 10:28:00 PST 2021


fowles added inline comments.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4224
+///     float z;
+///     auto f = [=]() { return x + y + z; };
+///   }
----------------
it would be nice to be able to do something like

```
int main() {
  int x, y;
  float z;
  auto f = [=, z]() { return x+ y + z; };
}
```

`lambdaExpr(forEachLambdaCapture(isImplicit())` matches `x` and `y` but not `z`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113575



More information about the cfe-commits mailing list