[clang] [Clang][Sema] Tweak tryCaptureVariable for unevaluated lambdas (PR #93206)

via cfe-commits cfe-commits at lists.llvm.org
Tue May 28 11:11:51 PDT 2024


================
@@ -1576,7 +1576,10 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
                       TrailingReturnTypeLoc, &DS),
                   std::move(Attributes), DeclEndLoc);
 
-    Actions.ActOnLambdaClosureQualifiers(Intro, MutableLoc);
+    // We have called ActOnLambdaClosureQualifiers for parentheses-less cases
----------------
cor3ntin wrote:

Yes, we need to set whether the lambda has a `mutable` keyword as soon as the parameters, if present, are parsed, as that affect the meaning of subsequent id-expressions

When there are no parens, there can be a noexcept clause for example, and parsing that does requires knowing whether the lambda is mutable, so that we can adjust the type of any reference-to-capture.


https://github.com/llvm/llvm-project/pull/93206


More information about the cfe-commits mailing list