[PATCH] D82904: [clang-tidy] Warn pointer captured in async block

Ellis Hoag via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 14:06:03 PDT 2020


ellis added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/NoEscapeCheck.cpp:34
+  const BlockDecl *EscapingBlockDecl = MatchedEscapingBlock->getBlockDecl();
+  for (const BlockDecl::Capture &CapturedVar : EscapingBlockDecl->captures()) {
+    const VarDecl *Var = CapturedVar.getVariable();
----------------
aaron.ballman wrote:
> This makes me think we should extend the `hasAnyCaptures()` AST matcher so it works with blocks as well as lambdas. It would be nice to do all of this from the matcher interface.
Should I add a TODO for this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82904





More information about the cfe-commits mailing list