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

--- Comment #5 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:9f13c7ad960a0f2e150dd2f668a8d155b76389db

commit r10-9510-g9f13c7ad960a0f2e150dd2f668a8d155b76389db
Author: Iain Sandoe <i...@sandoe.co.uk>
Date:   Tue Feb 16 09:07:32 2021 +0000

    coroutines : Remove throwing_cleanup marks from the ramp [PR95822].

    The FE contains a mechanism for cleaning up return expressions if a
    function throws during the execution of cleanups prior to the return.

    If the original function has a return value with a non-trivial DTOR
    and the body contains a var with a DTOR that might throw, the function
    decl is marked "throwing_cleanup".

    However, we do not [in the coroutine ramp function, which is
    synthesised], use any body var types with DTORs that might throw.

    The original body [which will then contain the type with the throwing
    DTOR] is transformed into the actor function which only contains void
    returns, and is also wrapped in a try-catch block.

    So (a) the 'throwing_cleanup' is no longer correct for the ramp and
       (b) we do not need to transfer it to the actor which only contains
           void returns.

    gcc/cp/ChangeLog:

            PR c++/95822
            * coroutines.cc (morph_fn_to_coro): Unconditionally remove any
            set throwing_cleanup marker.

    gcc/testsuite/ChangeLog:

            PR c++/95822
            * g++.dg/coroutines/pr95822.C: New test.

    (cherry picked from commit 7005a50d0121954031a223ea5a6c57aaa7e3efd3)
  • [Bug c++/95822] [coroutines] co... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to