This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115g. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-16


2934. Unclear semantics of exception escaping from unhandled_exception

Section: 9.5.4  [dcl.fct.def.coroutine]     Status: open     Submitter: Brian Bi     Date: 2024-07-13

(From submission #574. See also coroutines-ts#17 and coroutines-ts#30.)

Subclause 9.5.4 [dcl.fct.def.coroutine] paragraph 14 specifies:

If the evaluation of the expression promise.unhandled_exception() exits via an exception, the coroutine is considered suspended at the final suspend point and the exception propagates to the caller or resumer.

However, implementations destroy the promise object, the parameter copies, and the coroutine state before propagating the exception, which is consistent with the as-if code presented in 9.5.4 [dcl.fct.def.coroutine] paragraph 5.

CWG 2024-11-08

The implementations are correct; the normative wording needs to be amended.