ahatanak added a comment. Doesn't `Sema::FunctionScopeRAII` pop the lambda scope when it goes out of scope?
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. 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