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

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

https://gcc.gnu.org/g:5830fffacd05463c20b592bb6ed20e333d7d272b

commit r11-8715-g5830fffacd05463c20b592bb6ed20e333d7d272b
Author: Jason Merrill <ja...@redhat.com>
Date:   Mon May 31 12:36:25 2021 -0400

    c++: missing dtor with -fno-elide-constructors [PR100838]

    tf_no_cleanup only applies to the outermost TARGET_EXPR, and we already
    clear it for nested calls in build_over_call, but in this case both
    constructor calls came from convert_like, so we need to clear it in the
    recursive call as well.  This revealed that we were adding an extra
    ck_rvalue in direct-initialization cases where it was wrong.

    For GCC 11, limit the changes to -fno-elide-constructors.

            PR c++/100838

    gcc/cp/ChangeLog:

            * call.c (convert_like_internal): Clear tf_no_cleanup when
            recursing.
            (build_user_type_conversion_1): Only add ck_rvalue if
            LOOKUP_ONLYCONVERTING.

    gcc/testsuite/ChangeLog:

            * g++.dg/init/no-elide2.C: New test.

Reply via email to