Created on 2023-08-23.00:00:00 last changed 7 months ago
Proposed resolution (approved by CWG 2023-10-06):
Change in 7.6.2.4 [expr.await] paragraph 1 as follows:
The co_await expression is used to suspend evaluation of a coroutine (9.5.4 [dcl.fct.def.coroutine]) while awaiting completion of the computation represented by the operand expression. Suspending the evaluation of a coroutine transfers control to its caller or resumer.
Change 8.7.4 [stmt.return] paragraph 1 as follows:
A function returns control to its caller by the return statement.
Change 8.7.5 [stmt.return.coroutine] paragraph 1 as follows:
A coroutine returns to its caller or resumer (9.5.4 [dcl.fct.def.coroutine]) by the co_return statement or when suspended (7.6.2.4 [expr.await]).A co_return statement transfers control to the caller or resumer of a coroutine (9.5.4 [dcl.fct.def.coroutine]). A coroutine shall not enclose a return statement (8.7.4 [stmt.return]).
Change in 9.5.4 [dcl.fct.def.coroutine] paragraph 10 as follows:
If the allocation function returns nullptr, the coroutinereturnstransfers control to the caller of the coroutine and the return value is obtained by a call to T::get_return_object_on_allocation_failure(), where T is the promise type.
[Accepted as a DR at the November, 2023 meeting.]
In 8.7.4 [stmt.return] and 8.7.5 [stmt.return.coroutine], the standard uses the phrasing "returns to its caller" when specifying return or co_return. It would be better to talk about transfer of control, which is a term used elsewhere in the standard.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-04-05 21:43:46 | admin | set | status: dr -> drwp |
2023-12-19 10:15:28 | admin | set | status: ready -> dr |
2023-12-02 15:54:05 | admin | set | status: tentatively ready -> ready |
2023-10-06 22:55:13 | admin | set | status: open -> tentatively ready |
2023-08-29 19:50:46 | admin | set | messages: + msg7417 |
2023-08-23 00:00:00 | admin | create |