[Sema] Fix crash when evaluating nested call with value-dependent arg
Fix an edge case `ExprConstant.cpp`'s `EvaluateWithSubstitution` when called by `CheckEnableIf` The assertion in `CallStackFrame::getTemporary` could fail during evaluation of nested calls to a function using `enable_if` when the second argument was a value-dependent expression. This caused a temporary to be created for the second argument with a given version during the evaluation of the inner call, but we bailed out when evaluating the second argument of the outer call due to the expression being value-dependent. After bailing out, we tried to clean up the argument's value slot but it caused an assertion to trigger in `getTemporary` as a temporary for the second argument existed, but only for the inner call and not the outer call. See the test case for a more complete description of the issue. Reviewed By: ahatanak Differential Revision: https://reviews.llvm.org/D139713
Loading
Please sign in to comment