4133. awaitable-receiver's members are potentially throwing

Section: 33.12.1 [exec.as.awaitable] Status: New Submitter: Eric Niebler Opened: 2024-07-30 Last modified: 2024-08-21

Priority: 1

View all issues with New status.

Discussion:

The specification of awaitable-receiver in 33.12.1 [exec.as.awaitable]/p4 as of N4988 is not taking into consideration the fact that the resume() and promise() member functions on coroutine_handle<P> are not marked noexcept. awaitable-receiver's member functions must all be noexcept, but they are specified as being "equivalent to" statement that call resume() and promise() outside of try/catch blocks.

[2024-08-21; Reflector poll]

Set priority to 1 after reflector poll.

promise() can probably be Throws: Nothing (along with a bunch of other coroutine_handle members), but resume() certainly can throw. Also AS-EXCEPT-PTR can throw for the error_code case (that might be worth a separate issue though).

Proposed resolution: