[PATCH] D124012: [Clang] Fix references to captured variables in dependant context.

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 10:41:17 PDT 2022


cor3ntin marked an inline comment as done.
cor3ntin added inline comments.


================
Comment at: clang/lib/Sema/SemaLambda.cpp:539-546
 void Sema::buildLambdaScope(LambdaScopeInfo *LSI, CXXMethodDecl *CallOperator,
                             SourceRange IntroducerRange,
                             LambdaCaptureDefault CaptureDefault,
                             SourceLocation CaptureDefaultLoc,
-                            bool ExplicitParams, bool ExplicitResultType,
-                            bool Mutable) {
+                            bool ExplicitParams, bool Mutable) {
   buildLambdaScopeCaptures(LSI, CallOperator, IntroducerRange, CaptureDefault,
                            CaptureDefaultLoc, ExplicitParams, Mutable);
----------------
aaron.ballman wrote:
> IIRC, we added `buildLambdaScope()` quite recently, so perhaps that function should go away now and callers just call `buildLambdaScopeCaptures()` directly?
I got rid of `buildLambdaScopeCaptures` - as we also set things related to parameters / mutable, it makes more sense that way


================
Comment at: clang/lib/Sema/SemaLambda.cpp:1377
 
-  ContextRAII ManglingContext(*this, Class->getDeclContext());
+  Method->setInnerLocStart(LambdaLoc);
+  CompleteLambdaCallOperator(
----------------
aaron.ballman wrote:
> Out of curiosity, why isn't this part of `CompleteLambdaCallOperator()` like all the other setters? (Should template instantiation also be setting this?)
No good reason - and template should have set this


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124012



More information about the cfe-commits mailing list