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

--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:050fc885a6e324a03a6397d86134ab4b68aac944

commit r12-10112-g050fc885a6e324a03a6397d86134ab4b68aac944
Author: Jason Merrill <ja...@redhat.com>
Date:   Tue Jan 23 15:41:09 2024 -0500

    c++: throwing cleanup after return [PR113347]

    Here we were assuming that current_retval_sentinel would be set if we have
    seen a throwing cleanup, but that's not the case if the cleanup is after
all
    returns.

    This change isn't needed on trunk, where current_retval_sentinel is set for
    all NRV functions.

            PR c++/113347

    gcc/cp/ChangeLog:

            * semantics.cc (finalize_nrv_r): Handle null
            current_retval_sentinel.

    gcc/testsuite/ChangeLog:

            * g++.dg/eh/return3.C: New test.

    (cherry picked from commit 713fbaff8b17a01d3b72110f89112851ed43a90a)

Reply via email to