[Bug c++/80135] [6/7/8 Regression] ICE in output_constructor_regular_field, at varasm.c:4968

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 1 11:42:00 GMT 2017


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, shall we just error out on this?  I'm afraid I don't see what else can be
done with this, we can only really initialize a flexible array member with
non-empty data if it is at the very end of the object, if it is in the middle
of an array or structure, even if we were silent in the past, we'd just emit a
bogus initializer.
GCC 5 rejected this bogosity:
pr80135.C:6:1: error: too many initializers for ‘int [0]’
So, the actual bug is in r231665 that started accepting this, it should have
never been accepted, not r234636 that just started asserting sane IL that
r231665 didn't produce.


More information about the Gcc-bugs mailing list