[PATCH] D97653: [clang-tidy] Fix RenamerClangTidy checks breaking lambda captures.
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 14 07:07:28 PDT 2021
aaron.ballman added a comment.
In D97653#2681458 <https://reviews.llvm.org/D97653#2681458>, @njames93 wrote:
> Use implicit capture instead of default capture.
>
> @aaron.ballman, Unfortunately the AST dump tests don't work as implicit captures don't appear to show up in the textual representation.
Yeah, I was suggesting to add that as part of this patch so it'd be testable. We currently print something like `-DeclRefExpr <col:14> 'int' lvalue Var 0x55b0ddc7f808 'b' 'int'` and I think if we changed `TextNodeDumper::VisitDeclRefExpr()` to also print out `RefersToEnclosingVariableOrCapture` and `RefersToImplicitCapture` only when they're set, we could output something like: `-DeclRefExpr <col:14> 'int' lvalue Var 0x55b0ddc7f808 'b' 'int' implicit_capture` or `-DeclRefExpr <col:14> 'int' lvalue Var 0x55b0ddc7f808 'b' 'int' explicit_capture`, which would be useful (in addition to making your changes testable). WDYT?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97653/new/
https://reviews.llvm.org/D97653
More information about the cfe-commits
mailing list