[PATCH] D96215: [clang-tidy] Aliasing: Add support for lambda captures.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 10 19:56:08 PDT 2021


NoQ added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/utils/Aliasing.cpp:45-48
+    return llvm::any_of(LE->captures(), [Var](const LambdaCapture &C) {
+      return C.capturesVariable() && C.getCaptureKind() == LCK_ByRef &&
+             C.getCapturedVar() == Var;
+    });
----------------
aaron.ballman wrote:
> NoQ wrote:
> > aaron.ballman wrote:
> > > Should this use `capturesByRef()` from https://reviews.llvm.org/D101787?
> > Yes and https://reviews.llvm.org/D101787 already converts this code to use `capturesByRef()` as soon as it introduces it!
> Ah! It wasn't clear to me that's how this patch was stacking up, thanks for the explanation.
I've been using the phabricator's parent/child revisions feature (aka the Stack tab). I guess i should pronounce such relations out loud because it's not super apparent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96215



More information about the cfe-commits mailing list