On 2/24/21 3:09 PM, Iain Sandoe wrote:
Hi,
As the PR notes, we were calling the promise CTOR with the original
function parameters, not the copy (as pointed, a previous wording of
the section on this was unambiguous). Fixed thus.
tested on x86_64-darwin, x86_64-linux-gnu,
this is a wrong-code bug,
OK for master / 10.x?
thanks
Iain
gcc/cp/ChangeLog:
PR c++/97587
* coroutines.cc (struct param_info): Track rvalue refs.
(morph_fn_to_coro): Track rvalue refs, and call the promise
CTOR with the frame copy of passed parms.
gcc/testsuite/ChangeLog:
PR c++/97587
* g++.dg/coroutines/coro1-refs-and-ctors.h: Add a CTOR with two
reference parms, to distinguish the rvalue ref. variant.
* g++.dg/coroutines/pr97587.C: New test.
ok, thanks
--
Nathan Sidwell