Index: decl.c =================================================================== --- decl.c (revision 154291) +++ decl.c (working copy) @@ -4707,7 +4707,7 @@ constructor_elt *end; } reshape_iter; -static tree reshape_init_r (tree, reshape_iter *, bool); +static tree reshape_init_r (tree, reshape_iter *, bool, bool); /* FIELD is a FIELD_DECL or NULL. In the former case, the value returned is the next FIELD_DECL (possibly FIELD itself) that can be @@ -4765,7 +4765,8 @@ tree elt_init; check_array_designated_initializer (d->cur); - elt_init = reshape_init_r (elt_type, d, /*first_initializer_p=*/false); + elt_init = reshape_init_r (elt_type, d, /*first_initializer_p=*/false, + false); if (elt_init == error_mark_node) return error_mark_node; CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (new_init), NULL_TREE, elt_init); @@ -4857,7 +4858,7 @@ /* Loop through the initializable fields, gathering initializers. */ while (d->cur != d->end) { - tree field_init; + tree field_init, nfield; /* Handle designated initializers, as an extension. */ if (d->cur->index) @@ -4876,8 +4877,9 @@ if (!field) break; + nfield = next_initializable_field (TREE_CHAIN (field)); field_init = reshape_init_r (TREE_TYPE (field), d, - /*first_initializer_p=*/false); + /*first_initializer_p=*/false, !nfield); if (field_init == error_mark_node) return error_mark_node; @@ -4891,7 +4893,7 @@ if (TREE_CODE (type) == UNION_TYPE) break; - field = next_initializable_field (TREE_CHAIN (field)); + field = nfield; } return new_init; @@ -4904,7 +4906,7 @@ outermost CONSTRUCTOR node. */ static tree -reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p) +reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p, bool no_warn) { tree init = d->cur->value; @@ -5016,8 +5018,9 @@ } } - warning (OPT_Wmissing_braces, "missing braces around initializer for %qT", - type); + if (!no_warn) + warning (OPT_Wmissing_braces, "missing braces around initializer " + "for %qT", type); } /* Dispatch to specialized routines. */ @@ -5066,7 +5069,7 @@ d.cur = VEC_index (constructor_elt, v, 0); d.end = d.cur + VEC_length (constructor_elt, v); - new_init = reshape_init_r (type, &d, true); + new_init = reshape_init_r (type, &d, true, false); if (new_init == error_mark_node) return error_mark_node;