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.
All implementations first destroy the promise object followed by the parameter copies, then deallocate the coroutine state, and finally return control to the caller: https://godbolt.org/z/e7edh8d9o
The behaviour of the implementations is expected based on the code in [dcl.fct.def.coroutine]/5, but the wording in p14 suggests that suspension occurs immediately when unhandled_exception() exits, prior to any stack unwinding in the coroutine. The intent should be clarified.
Full name of submitter: Brian Bi
Reference (section label): [dcl.fct.def.coroutine]
Issue description: [dcl.fct.def.coroutine]/14 says:
All implementations first destroy the promise object followed by the parameter copies, then deallocate the coroutine state, and finally return control to the caller: https://godbolt.org/z/e7edh8d9o
The behaviour of the implementations is expected based on the code in [dcl.fct.def.coroutine]/5, but the wording in p14 suggests that suspension occurs immediately when
unhandled_exception()
exits, prior to any stack unwinding in the coroutine. The intent should be clarified.