[expr.await] The lifetime of parameters and variables that are defined in a coroutine #4867
Labels
cwg
Issue must be reviewed by CWG.
not-editorial
Issue is not deemed editorial; the editorial issue is kept open for tracking.
[expr.await] p5
However, whether a variable with automatic storage duration is active or not is totally defined in [stmt.dcl] p3, which means "without exiting any scopes" seems to expound nothing. According to [basic.stc.auto] p1, the storage duration of the parameters and variables defined in a coroutine all have automatic storage duration, hence, their lifetimes are governed by [stmt.dcl] p3. Since what [expr.await] p5 says and [stmt.dcl] p3 says that
the lifetime of the parameters of a coroutine has ended when the first suspension occurs (which returns to the caller or resume, that is, Q is after its body). However, it cannot interpret the lifetimes of these variables defined in the body, that is, a suspension may not end their lifetimes.
If we admit the effect of "without exiting any scopes", which in turn, cannot interpret the lifetimes of the parameters of a coroutine, since the parameter scope does not exit out. In conclusion, regardless of [stmt.dcl] p3 or "without exiting any scopes", neither of them can interpret both the lifetime of parameters of the coroutine and the variables in that coroutine.
The text was updated successfully, but these errors were encountered: