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

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 7 13:12:51 PST 2023


ahatanak added a comment.

I agree that pushing an empty scope without initializing any of its members seems wrong.

Instead of doing that, the updated patch changes the decl context instead if we are trying to capture a variable in a default argument expression of a lambda call operator. I think that's okay since the type of the `DeclRefExpr` of the variable appearing in the default argument expression shouldn't depend on whether it's captured by the lambda, if I understand the standard rules correctly (note that when clang crashes, `tryCaptureVariable` is being called by `getCapturedDeclRefType`).


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