https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97587
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>: https://gcc.gnu.org/g:88bb77a8dcf75f556b8dcb24b8785b4567d24e4f commit r10-9511-g88bb77a8dcf75f556b8dcb24b8785b4567d24e4f Author: Iain Sandoe <i...@sandoe.co.uk> Date: Mon Feb 15 16:13:36 2021 +0000 coroutines : Call promise CTOR with parm copies [PR97587]. 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 was unambiguous). Fixed thus. 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. (cherry picked from commit b8ff3f8efeda02a6bedebfaf20b93645ae3bb5b8)