[clang] [Clang] Only remove lambda scope after computing evaluation context (PR #154106)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 18 06:54:56 PDT 2025


================
@@ -15791,12 +15791,9 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) {
     return ExprError();
   }
 
-  // Copy the LSI before ActOnFinishFunctionBody removes it.
----------------
zyn0217 wrote:

Yes, this is just an inevitable consequence of PopScope deleting the scope proactively.

At the beginning I tried to move that call to the end of BuildLambdaExpr. Then I run into some crashes with some OpenMP tests... All of them occur in computing captures which I think is relying on the fact of LSI being popped (and deleted) at that point.

Though in theory we may get rid of it, while I'm unsure how many additional changes are needed and thus I left that copy at the top of the function :/





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


More information about the cfe-commits mailing list