typeck2.c (process_init_constructor): Sorry about non-trivial labeled initializers.

* typeck2.c (process_init_constructor): Sorry about non-trivial
	labeled initializers.
	* parse.y (initlist): Reenable labeled initializers.

From-SVN: r18121
This commit is contained in:
Jason Merrill 1998-02-19 10:41:58 +00:00 committed by Jason Merrill
parent de5750097b
commit c8fcb3318e
4 changed files with 3857 additions and 3834 deletions

View File

@ -1,3 +1,9 @@
Thu Feb 19 10:36:48 1998 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (process_init_constructor): Sorry about non-trivial
labeled initializers.
* parse.y (initlist): Reenable labeled initializers.
Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>
* pt.c (coerce_template_parms) Add a new parameter, is_tmpl_parm,

File diff suppressed because it is too large Load Diff

View File

@ -2179,20 +2179,13 @@ initlist:
{ $$ = build_tree_list (NULL_TREE, $$); }
| initlist ',' init
{ $$ = expr_tree_cons (NULL_TREE, $3, $$); }
/* These are for labeled elements, which don't currently work
as documented, or give warning messages when used with
-ansi -pedantic, or match the syntax currently used in the
C front-end. They are therefore disabled.
/* These are for labeled elements. */
| '[' expr_no_commas ']' init
{ $$ = build_expr_list ($2, $4); }
| initlist ',' CASE expr_no_commas ':' init
{ $$ = expr_tree_cons ($4, $6, $$); }
| identifier ':' init
{ $$ = build_expr_list ($$, $3); }
| initlist ',' identifier ':' init
{ $$ = expr_tree_cons ($3, $5, $$); }
*/
;
fn.defpen:

View File

@ -962,6 +962,9 @@ process_init_constructor (type, init, elts)
{
register tree next1;
if (TREE_PURPOSE (tail))
sorry ("non-trivial labeled initializers");
if (TREE_VALUE (tail) != 0)
{
tree tail1 = tail;
@ -1038,6 +1041,10 @@ process_init_constructor (type, init, elts)
if (TREE_CODE (field) != FIELD_DECL)
continue;
if (TREE_PURPOSE (tail)
&& TREE_PURPOSE (tail) != DECL_NAME (field))
sorry ("non-trivial labeled initializers");
if (TREE_VALUE (tail) != 0)
{
tree tail1 = tail;