When a coroutine is invoked, after initializing its parameters ([expr.call]), a copy is created for each coroutine parameter. For a parameter of type cv T, the copy is a variable of type cv T with automatic storage duration that is direct-initialized from an xvalue of type T referring to the parameter. [...]
Considering the following coroutine:
task<void> f(int& p)
{
...
}
the copy of the parameter p has type int& and it is initialized with an xvalue, which should not be legal.
[dcl.fct.def.coroutine] paragraph 13 states the following:
Considering the following coroutine:
the copy of the parameter
p
has typeint&
and it is initialized with an xvalue, which should not be legal.Is there something else that I might be missing?
Thank you!