https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124548
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |iains at gcc dot gnu.org
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So reading the standard it says:
in a coroutine (9.5.4), a copy of a coroutine parameter can be omitted and
references to that copy replaced with references to the corresponding parameter
if the meaning of the program will be unchanged except for the execution of a
constructor and destructor for the parameter copy object
Which to me reads that const references and rvalue references can't be copy
elision. Only normal references. As the lifetime of the const/rvalue reference
is not extended after the call of the corountine parameter.
Or it means we need to change the TARGET_EXPR for the call argument into one
which is extended.
Either way the front-end needs to change. Or the testcase is wrong and I don't
understand co-routines at all.