Title
Flowing off the end of a coroutine
Status
cd6
Section
8.7.5 [stmt.return.coroutine]
Submitter
Lewis Baker

Created on 2020-02-14.00:00:00 last changed 20 months ago

Messages

Date: 2020-07-15.00:00:00

Proposed resolution (July, 2020):

Change 8.7.5 [stmt.return.coroutine] paragraph 3 as follows:

If p.return_void() is a valid expression, flowing off the end of a coroutine's function-body is equivalent to a co_return with no operand;otherwise flowing off the end of a coroutine's function-body results in undefined behavior.
Date: 2020-11-15.00:00:00

[Accepted at the November, 2020 meeting.]

There are two references to “flowing off the end of a coroutine”, specifically in 8.7.5 [stmt.return.coroutine] paragraph 3:

If p.return_void() is a valid expression, flowing off the end of a coroutine is equivalent to a co_return with no operand; otherwise flowing off the end of a coroutine results in undefined behavior.

and 9.5.4 [dcl.fct.def.coroutine] paragraph 11:

The coroutine state is destroyed when control flows off the end of the coroutine or...

These mean different things and should be clarified.

History
Date User Action Args
2022-08-19 07:54:33adminsetstatus: drwp -> cd6
2021-02-24 00:00:00adminsetstatus: dr -> drwp
2020-12-15 00:00:00adminsetmessages: + msg6324
2020-02-14 00:00:00admincreate