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

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

https://gcc.gnu.org/g:4231a43fd4ac6ccffd4d4b7cca70d45b2368cede

commit r9-10176-g4231a43fd4ac6ccffd4d4b7cca70d45b2368cede
Author: Jason Merrill <ja...@redhat.com>
Date:   Sat Apr 3 16:17:29 2021 -0400

    c++: array new initialized from a call [PR99643]

    Here the get_foo() call results in a TARGET_EXPR, which we strip in
    massage_init_elt, but then when build_vec_init tries to use it to
initialize
    the array element we crash because build_aggr_init expects a class rvalue
to
    have a TARGET_EXPR.  So don't strip it.

    The stripping was added in r206639 for PR59659, so I checked that removing
    it didn't significantly increase compile time or memory usage for that
    testcase; compile time was unaffected, memory usage increased by 0.00004%.

    gcc/cp/ChangeLog:

            PR c++/99643
            * typeck2.c (massage_init_elt): Don't strip TARGET_EXPR.

    gcc/testsuite/ChangeLog:

            PR c++/99643
            * g++.dg/cpp0x/initlist-new5.C: New test.
  • [Bug c++/99643] [9 Regression] ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to