[PATCH] D143109: [Sema] Push a LambdaScopeInfo before calling SubstDefaultArgument

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 2 09:52:31 PST 2023


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



More information about the cfe-commits mailing list