[clang] [Clang] Fix incorrect mutability of decltype((x)) in lambda return types (PR #180690)

Samrudh Nelli via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 10 10:50:52 PST 2026


================
@@ -1383,6 +1383,9 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer(
     addStaticToLambdaDeclSpecifier(*this, StaticLoc, DS);
     addConstexprToLambdaDeclSpecifier(*this, ConstexprLoc, DS);
     addConstevalToLambdaDeclSpecifier(*this, ConstevalLoc, DS);
+    if (clang::sema::LambdaScopeInfo *LSI = Actions.getCurLambda()) {
+      LSI->Mutable = MutableLoc.isValid();
+    }
----------------
SamrudhNelli wrote:

@cor3ntin You were correct, moving `ActOnLambdaClosureQualifiers` before `ParseTrailingReturnType` actually works.
Thanks for your insight. Let me know if any other changes are to be made.

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


More information about the cfe-commits mailing list