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

--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Feb 21 18:16:15 2019
New Revision: 269073

URL: https://gcc.gnu.org/viewcvs?rev=269073&root=gcc&view=rev
Log:
        PR c++/88690 - C++17 ICE with empty base in aggregate.

Base fields for empty bases appear in initialization order, which may not be
the same as layout order.  If they also show up in a CONSTRUCTOR in that
order, output_constructor_regular_field aborts because it understandably
doesn't want to go backwards.  I also considered making o_c_r_f more
tolerant of the case where the out-of-order field has fieldsize 0, and so no
actual data needs to be emitted, but we might as well avoid adding an
element to the CONSTRUCTOR in the first place.

        * typeck2.c (process_init_constructor_record): Skip trivial
        initialization of an empty base.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1z/aggr-base7.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck2.c

Reply via email to