]> gcc.gnu.org Git - gcc.git/commitdiff
(process_init_constructor): When initializing a union,
authorRichard Stallman <rms@gnu.org>
Sun, 18 Oct 1992 08:12:53 +0000 (08:12 +0000)
committerRichard Stallman <rms@gnu.org>
Sun, 18 Oct 1992 08:12:53 +0000 (08:12 +0000)
handle the case of an empty init list.

From-SVN: r2507

gcc/c-typeck.c

index 6341cc2ef6b35f168239529de7689f3866fc8ed0..9c4c1a421be7665f7583e73e21a31e0f9e086f56 100644 (file)
@@ -5202,6 +5202,12 @@ process_init_constructor (type, init, elts, constant_value, constant_element,
 
       /* For a union, get the initializer for 1 fld.  */
 
+      if (tail == 0)
+       {
+         error ("empty initializer for union");
+         tail = build_tree_list (0, 0);
+       }
+
       /* If this element specifies a field, initialize via that field.  */
       if (TREE_PURPOSE (tail) != 0)
        {
This page took 0.067803 seconds and 5 git commands to generate.