ahatanak added a comment. I'm still don't understand what the problem is about cleaning up the lambda scope.
`PushLambdaScope` creates a new `LambdaScopeInfo` and pushes onto `FunctionScopes`. https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/Sema.cpp#L2137 When `Sema::FunctionScopeRAII` goes out of scope, its destructor calls `PopFunctionScopeInfo`. https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Sema/Sema.h#L5048 `PopFunctionScopeInfo` then pops the `FunctionScopeInfo` at the top of the stack, which is the `LambdaScopeInfo` that was pushed earlier, and `PoppedFunctionScopePtr` makes sure the popped scope is deleted. https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/Sema.cpp#L2243 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143109/new/ https://reviews.llvm.org/D143109 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits