[Bug c++/95350] [coroutines] coroutines with move-only by-value parameters attempt to copy parameter instead of move it

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 12 17:32:24 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95350

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

https://gcc.gnu.org/g:284f809ef7fe8fa6b518c103d31e514a98f0f36e

commit r10-8285-g284f809ef7fe8fa6b518c103d31e514a98f0f36e
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Fri Jun 12 08:28:35 2020 +0100

    coroutines: Correct handling of references in parm copies [PR95350].

    Adjust to handle rvalue refs the same way as clang, and to correct
    the handling of moves when a copy CTOR is present.  This is one area
    where we could make things easier for the end-user (as was implemented
    before this change), however there needs to be agreement about when the
    full statement containing a coroutine call ends (i.e. when the ramp
    terminates or when the coroutine terminates).

    gcc/cp/ChangeLog:

            PR c++/95350
            * coroutines.cc (struct param_info): Remove rv_ref field.
            (build_actor_fn): Remove specifial rvalue ref handling.
            (morph_fn_to_coro): Likewise.

    gcc/testsuite/ChangeLog:

            PR c++/95350
            * g++.dg/coroutines/torture/func-params-08.C: Adjust test to
            reflect that all rvalue refs are dangling.
            * g++.dg/coroutines/torture/func-params-09-awaitable-parms.C:
            Likewise.
            * g++.dg/coroutines/pr95350.C: New test.

    (cherry picked from commit 88f48e2967ead9be262483618238efa9c7c842ec)


More information about the Gcc-bugs mailing list