================ @@ -1186,15 +1188,28 @@ void Sema::ActOnLambdaExpressionAfterIntroducer(LambdaIntroducer &Intro, CheckCXXThisCapture(C->Loc, /*Explicit=*/true, /*BuildAndDiagnose*/ true, /*FunctionScopeIndexToStopAtPtr*/ nullptr, C->Kind == LCK_StarThis); - if (!LSI->Captures.empty()) - LSI->ExplicitCaptureRanges[LSI->Captures.size() - 1] = C->ExplicitRange; - continue; + if (!LSI->Captures.empty()) { // + SourceManager &SourceMgr = Context.getSourceManager(); + const LangOptions &LangOpts = Context.getLangOpts(); + SourceRange TrimmedRange = + Lexer::makeFileCharRange( + CharSourceRange::getTokenRange(C->ExplicitRange), SourceMgr, + LangOpts) + .getAsRange(); ---------------- ojhunt wrote:
I'd prefer `.getAsRange();` on the preceding line, but if clang-format puts it here I guess we accept that. https://github.com/llvm/llvm-project/pull/117953 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits