[PATCH] D96215: [clang-tidy] Aliasing: Add support for lambda captures.
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 4 13:58:05 PDT 2021
xazax.hun added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/utils/Aliasing.cpp:45
+ // Treat lambda capture by reference as a form of taking a reference.
+ return llvm::any_of(LE->captures(), [Var](const LambdaCapture &C) {
+ return C.capturesVariable() && C.getCaptureKind() == LCK_ByRef &&
----------------
Will this cover generalized captures? E.g.:
```
int i;
auto lambda = [foo=&i] { return *foo; };
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96215/new/
https://reviews.llvm.org/D96215
More information about the cfe-commits
mailing list