Full name of submitter: Artem Koton
Reference (section label): [stmt.dcl] p2
Issue description:
P1787 changed the wording of [dcl.fct.def.coroutine/11] regarding the destruction of variables with automatic storage duration from:
In the latter case objects with automatic storage duration that are in scope at the suspend point are destroyed in the reverse order of the construction.
to:
In the latter case, control in the coroutine is considered to be transferred out of the function ([stmt.dcl/2]).
According to [stmt.dcl/2]:
Upon each transfer of control (including sequential execution of statements) within a function from point P to point Q, all block variables with automatic storage duration that are active at P and not at Q are destroyed in the reverse order of their construction.
This only applies to transferring control "within a function", which does not seem to cover the case for coroutines. If so, there currently appears to be no wording specifying how local variables are destroyed when a coroutine is exited.
Suggested resolution:
Clarify the wording of [stmt.dcl/2] to cover transfers of control out of a function.
Full name of submitter: Artem Koton
Reference (section label): [stmt.dcl] p2
Issue description:
P1787 changed the wording of [dcl.fct.def.coroutine/11] regarding the destruction of variables with automatic storage duration from:
to:
According to [stmt.dcl/2]:
This only applies to transferring control "within a function", which does not seem to cover the case for coroutines. If so, there currently appears to be no wording specifying how local variables are destroyed when a coroutine is exited.
Suggested resolution:
Clarify the wording of [stmt.dcl/2] to cover transfers of control out of a function.