https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100772
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Iain D Sandoe <ia...@gcc.gnu.org>: https://gcc.gnu.org/g:f647906ef227bc22af224d955a408d776cfddb04 commit r11-11542-gf647906ef227bc22af224d955a408d776cfddb04 Author: Iain Sandoe <i...@sandoe.co.uk> Date: Sun Oct 3 19:46:09 2021 +0100 coroutines: Pass lvalues to user-defined operator new [PR 100772]. The wording of the standard has been clarified to be explicit that the the parameters to any user-defined operator-new in the promise class should be lvalues. Signed-off-by: Iain Sandoe <i...@sandoe.co.uk> PR c++/100772 gcc/cp/ChangeLog: * coroutines.cc (morph_fn_to_coro): Convert function parms from reference before constructing any operator-new args list. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr100772-a.C: New test. * g++.dg/coroutines/pr100772-b.C: New test. (cherry picked from commit 921942a8a106cb53994c21162922e4934eb3a3e0)