[clang] [clang] Fix crash parsing delayed lambda default arguments (PR #213556)

Gauarv Chaudhary via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 3 00:31:49 PDT 2026


ANAMASGARD wrote:

@TPPPP72  The assertion was based on an invariant that holds during normal lambda parsing, but not during delayed parsing. When this default argument is reparsed, the lambda’s LambdaScopeInfo has already been popped from S.FunctionScopes, while the declaration context still refers to the lambda call operator. Therefore, reaching the end of FunctionScopes is a valid and reproducible state, not an internal compiler error. The guard handles that state, preserves the existing behavior when the scope is present, and allows Clang to continue and emit the normal diagnostics instead of crashing. The regression test verifies this exact behavior.

https://github.com/llvm/llvm-project/pull/213556


More information about the cfe-commits mailing list