diff options
author | Jason Merrill <jason@redhat.com> | 2003-02-18 13:16:40 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-02-18 13:16:40 -0500 |
commit | 04b03085740b48a3419346b7f52c2b799fc1b086 (patch) | |
tree | 493467dacb638cec7c9020586fa9e01699160e1a /gcc | |
parent | a6bd211dbfba9b5e31d52f68ee5fc1ef58520117 (diff) | |
download | gcc-04b03085740b48a3419346b7f52c2b799fc1b086.zip gcc-04b03085740b48a3419346b7f52c2b799fc1b086.tar.gz gcc-04b03085740b48a3419346b7f52c2b799fc1b086.tar.bz2 |
re PR c++/9623 (named initializer regression)
PR c++/9623
* decl.c (reshape_init): Don't mess with initializer labels.
From-SVN: r63045
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/init1.C | 5 |
3 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c957c26..069c009 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 82ff6af..adde628 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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 index 0000000..c90e2c9 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/init1.C @@ -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 }; |