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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 6 04:26:45 PDT 2021


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM!



================
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;
+    });
----------------
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.


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

https://reviews.llvm.org/D96215



More information about the cfe-commits mailing list