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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The following seems to work and regtests cleanly.  But I have to say I'm
somewhat dubious now about changing this at all.  I suppose I should try to
compile e.g. the Linux kernel with this patch and see if anything breaks.

diff --git gcc/c/c-typeck.c gcc/c/c-typeck.c
index ebe4c73..590e235 100644
--- gcc/c/c-typeck.c
+++ gcc/c/c-typeck.c
@@ -7565,7 +7565,7 @@ pop_init_level (location_t loc, int implicit,
       /* Silently discard empty initializations.  The parser will
      already have pedwarned for empty brackets.  */
       if (integer_zerop (constructor_unfilled_index))
-    constructor_type = NULL_TREE;
+    /* Do nothing.  */;
       else
     {
       gcc_assert (!TYPE_SIZE (constructor_type));

Reply via email to