FreeBSD/contrib/gcc/cp/decl.c
/* Undo the brace-elision allowed by [dcl.init.aggr] in a
   brace-enclosed aggregate initializer.

   INIT is the CONSTRUCTOR containing the list of initializers describing
   a brace-enclosed initializer for an entity of the indicated aggregate TYPE.
   It may not presently match the shape of the TYPE; for example:

     struct S { int a; int b; };
     struct S a[] = { 1, 2, 3, 4 };

   Here INIT will hold a VEC of four elements, rather than a
   VEC of two elements, each itself a VEC of two elements.  This
   routine transforms INIT from the former form into the latter.  The
   revised CONSTRUCTOR node is returned.  */
Undo the brace-elision allowed by [dcl.init.aggr] in a
brace-enclosed aggregate initializer.

INIT is the CONSTRUCTOR containing the list of initializers describing
a brace-enclosed initializer for an entity of the indicated aggregate TYPE.
It may not presently match the shape of the TYPE; for example.



Here INIT will hold a VEC of four elements, rather than a
VEC of two elements, each itself a VEC of two elements.  This
routine transforms INIT from the former form into the latter.  The
revised CONSTRUCTOR node is returned.
Undo the brace - elision allowed by [ dcl . init . aggr ] in a brace - enclosed aggregate initializer . INIT is the CONSTRUCTOR containing the list of initializers describing a brace - enclosed initializer for an entity of the indicated aggregate TYPE . It may not presently match the shape of the TYPE ; for example . Here INIT will hold a VEC of four elements rather than a VEC of two elements each itself a VEC of two elements . This routine transforms INIT from the former form into the latter . The revised CONSTRUCTOR node is returned .
tree
reshape_init (tree type, tree init)
{
  VEC(constructor_elt, gc) *v;
  reshape_iter d;
  tree new_init;
  gcc_assert (BRACE_ENCLOSED_INITIALIZER_P (init));
  v = CONSTRUCTOR_ELTS (init);
  if (VEC_empty (constructor_elt, v))
    return init;
  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);
  if (new_init == error_mark_node)
    return error_mark_node;
  if (d.cur != d.end)
    error ("too many initializers for %qT", type);
  return new_init;
}
tree reshape_init ( tree type , tree init ) { VEC ( constructor_elt , gc ) * v ; reshape_iter d ; tree new_init ; gcc_assert ( BRACE_ENCLOSED_INITIALIZER_P ( init ) ) ; v = CONSTRUCTOR_ELTS ( init ) ; if ( VEC_empty ( constructor_elt , v ) ) return init ; 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 ) ; if ( new_init == error_mark_node ) return error_mark_node ; if ( d . cur != d . end ) error ( " " , type ) ; return new_init ; }
Undo the brace-elision allowed by [dcl.init.aggr] in a
brace-enclosed aggregate initializer.
Undo the brace - elision allowed by [ dcl . init . aggr ] in a brace - enclosed aggregate initializer .
/* An empty constructor does not need reshaping, and it is always a valid
     initializer.  */ /* Recurse on this CONSTRUCTOR.  */ /* Make sure all the element of the constructor were used. Otherwise,
     issue an error about exceeding initializers.  */