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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:4c6afbbd48f0c40ddf949bc403d9bd5f5e14204f

commit r12-6332-g4c6afbbd48f0c40ddf949bc403d9bd5f5e14204f
Author: Jason Merrill <ja...@redhat.com>
Date:   Wed Jan 5 11:18:25 2022 -0500

    c++: clean up ref-extended temp on throwing dtor [PR53868]

    We have wrap_temporary_cleanups to handle the EH region nesting problems
    between cleanups for complete variables and cleanups for temporaries used
in
    their construction, but we weren't calling it for temporaries extended from
    binding to a reference.

    We still don't want this for array cleanups (since my PR94041 fix), so I
    move that exception from initialize_local_var to wrap_temporary_cleanups.

            PR c++/53868

    gcc/cp/ChangeLog:

            * decl.c (cp_finish_decl): Use wrap_temporary_cleanups for
            cleanups from set_up_extended_ref_temp.
            (wrap_temporary_cleanups): Ignore array cleanups.
            (initialize_local_var): Don't check for array here.
            * cp-tree.h (BIND_EXPR_VEC_DTOR): New.
            * init.c (build_vec_delete_1): Set it.

    gcc/testsuite/ChangeLog:

            * g++.dg/eh/ref-temp1.C: New test.
            * g++.dg/eh/ref-temp2.C: New test.

Reply via email to