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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to