FreeBSD/contrib/gcc/cp/decl.c
/* Make TYPE a complete type based on INITIAL_VALUE.
   Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered,
   2 if there was no information (in which case assume 0 if DO_DEFAULT),
   3 if the initializer list is empty (in pedantic mode). */
Make TYPE a complete type based on INITIAL_VALUE.
Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered,
2 if there was no information (in which case assume 0 if DO_DEFAULT),
3 if the initializer list is empty (in pedantic mode).
Make TYPE a complete type based on INITIAL_VALUE . Return 0 if successful 1 if INITIAL_VALUE can ' t be deciphered 2 if there was no information ( in which case assume 0 if DO_DEFAULT ) 3 if the initializer list is empty ( in pedantic mode ) .
int
cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
{
  int failure;
  tree type, elt_type;
  if (initial_value)
    {
      if (char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (*ptype)))
	  && TREE_CODE (initial_value) == CONSTRUCTOR
	  && !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (initial_value)))
	{
	  VEC(constructor_elt,gc) *v = CONSTRUCTOR_ELTS (initial_value);
	  tree value = VEC_index (constructor_elt, v, 0)->value;
	  if (TREE_CODE (value) == STRING_CST
	      && VEC_length (constructor_elt, v) == 1)
	    initial_value = value;
	}
    }
  failure = complete_array_type (ptype, initial_value, do_default);
  type = *ptype;
  if (TYPE_DOMAIN (type))
    {
      elt_type = TREE_TYPE (type);
      TYPE_NEEDS_CONSTRUCTING (type) = TYPE_NEEDS_CONSTRUCTING (elt_type);
      TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
	= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (elt_type);
    }
  return failure;
}
int cp_complete_array_type ( tree * ptype , tree initial_value , bool do_default ) { int failure ; tree type , elt_type ; if ( initial_value ) { if ( char_type_p ( TYPE_MAIN_VARIANT ( TREE_TYPE ( * ptype ) ) ) && TREE_CODE ( initial_value ) == CONSTRUCTOR && ! VEC_empty ( constructor_elt , CONSTRUCTOR_ELTS ( initial_value ) ) ) { VEC ( constructor_elt , gc ) * v = CONSTRUCTOR_ELTS ( initial_value ) ; tree value = VEC_index ( constructor_elt , v , 0 ) -> value ; if ( TREE_CODE ( value ) == STRING_CST && VEC_length ( constructor_elt , v ) == 1 ) initial_value = value ; } } failure = complete_array_type ( ptype , initial_value , do_default ) ; type = * ptype ; if ( TYPE_DOMAIN ( type ) ) { elt_type = TREE_TYPE ( type ) ; TYPE_NEEDS_CONSTRUCTING ( type ) = TYPE_NEEDS_CONSTRUCTING ( elt_type ) ; TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( type ) = TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( elt_type ) ; } return failure ; }
Make TYPE a complete type based on INITIAL_VALUE.
Make TYPE a complete type based on INITIAL_VALUE .
/* An array of character type can be initialized from a
	 brace-enclosed string constant.

	 FIXME: this code is duplicated from reshape_init. Probably
	 we should just call reshape_init here?  */ /* We can create the array before the element type is complete, which
     means that we didn't have these two bits set in the original type
     either.  In completing the type, we are expected to propagate these
     bits.  See also complete_type which does the same thing for arrays
     of fixed size.  */