[PATCH] D96975: [Sema] Add some basic lambda capture fix-its
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 18 17:37:30 PST 2021
njames93 added inline comments.
================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:1229-1235
+static void buildLambdaThisCaptureFixit(Sema &Sema, LambdaScopeInfo *LSI) {
+ SourceLocation DiagLoc = LSI->IntroducerRange.getEnd();
+ assert(!LSI->isCXXThisCaptured());
+ Sema.Diag(DiagLoc, diag::note_lambda_this_capture_fixit)
+ << FixItHint::CreateInsertion(
+ DiagLoc, LSI->NumExplicitCaptures > 0 ? ", this" : "this");
+}
----------------
Could we just attach this fix directly to the warning?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96975/new/
https://reviews.llvm.org/D96975
More information about the cfe-commits
mailing list