]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/9623 (named initializer regression)
authorJason Merrill <jason@redhat.com>
Tue, 18 Feb 2003 18:16:40 +0000 (13:16 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 18 Feb 2003 18:16:40 +0000 (13:16 -0500)
        PR c++/9623
        * decl.c (reshape_init): Don't mess with initializer labels.

From-SVN: r63045

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.dg/ext/init1.C [new file with mode: 0644]

index c957c261dacbdbcd7c2dc0fe36a8a9b63abdde94..069c0097d03e8a72b72292d769bb3b8f42041637 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/9623
+       * decl.c (reshape_init): Don't mess with initializer labels.
+
 2003-02-18  Ben Elliston  <bje@redhat.com>
 
        PR other/7350
index 82ff6afeabd19a8d7b8c197a68236fdf67779173..adde6280a1de6df47ddc973d612e1d1af2db0da4 100644 (file)
@@ -7638,6 +7638,7 @@ reshape_init (tree type, tree *initp)
            {
              /* Loop through the initializable fields, gathering
                 initializers.  */
+              /* FIXME support non-trivial labeled initializers.  */
              while (*initp && field)
                {
                  tree field_init;
@@ -7652,8 +7653,6 @@ reshape_init (tree type, tree *initp)
                     initializer for the first member of the union.  */
                  if (TREE_CODE (type) == UNION_TYPE)
                    break;
-                 if (TREE_PURPOSE (field_init))
-                   field = TREE_PURPOSE (field_init);
                  field = next_initializable_field (TREE_CHAIN (field));
                }
            }
diff --git a/gcc/testsuite/g++.dg/ext/init1.C b/gcc/testsuite/g++.dg/ext/init1.C
new file mode 100644 (file)
index 0000000..c90e2c9
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/9623
+// Test for trivial use of named initializer extension
+
+struct S { int x;  int y; };
+S s = { x:1, y:2 };
This page took 0.098236 seconds and 5 git commands to generate.