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

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 1 23:44:22 PST 2023


cor3ntin added a comment.

In D143109#4097850 <https://reviews.llvm.org/D143109#4097850>, @ahatanak wrote:

> Doesn't `Sema::FunctionScopeRAII` pop the lambda scope when it goes out of scope?

No, sadly lambdas are handled differently

> https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Sema/Sema.h#L5042
>
> I also tried instantiating the default arguments after the call to `BuildLambdaExpr` using `LSICopy` (see https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/TreeTransform.h#L13477), which is the copy of the lambda scope, but I opted for the approach in this patch as using a dummy scope seemed sufficient.

I think the patch is good enough too, just questioning whether we want to add a "FIXME" comment for later (It would be good to try to clean up all of that, one day - if someone has time)


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