Description
https://godbolt.org/z/rvMWrhhYs
It seems that PopExpressionEvaluationContext
, which triggers the marking of expressions as immediate-escalating, is performed after the check for whether the function body contains an immediate-escalating expression. Consequently, immediate-escalating functions (i.e., lambdas and constexpr function template specializations) that contain a reference to a consteval function are never marked as immediate.
The RAII object whose teardown invokes PopExpressionEvaluationContext
is here, whereas the call that checks whether the function body contains an immediate-escalating expression is here (a few lines later, but within scope of the RAII guard).