FreeBSD/contrib/gcc/cp/typeck.c
/* Try to complete TYPE, if it is incomplete.  For example, if TYPE is
   a template instantiation, do the instantiation.  Returns TYPE,
   whether or not it could be completed, unless something goes
   horribly wrong, in which case the error_mark_node is returned.  */
Try to complete TYPE, if it is incomplete.  For example, if TYPE is
a template instantiation, do the instantiation.  Returns TYPE,
whether or not it could be completed, unless something goes
horribly wrong, in which case the error_mark_node is returned.
Try to complete TYPE if it is incomplete . For example if TYPE is a template instantiation do the instantiation . Returns TYPE whether or not it could be completed unless something goes horribly wrong in which case the error_mark_node is returned .
tree
complete_type (tree type)
{
  if (type == NULL_TREE)
    return error_mark_node;
  if (type == error_mark_node || COMPLETE_TYPE_P (type))
    ;
  else if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
    {
      tree t = complete_type (TREE_TYPE (type));
      unsigned int needs_constructing, has_nontrivial_dtor;
      if (COMPLETE_TYPE_P (t) && !dependent_type_p (type))
	layout_type (type);
      needs_constructing
	= TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (t));
      has_nontrivial_dtor
	= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (t));
      for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
	{
	  TYPE_NEEDS_CONSTRUCTING (t) = needs_constructing;
	  TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = has_nontrivial_dtor;
	}
    }
  else if (CLASS_TYPE_P (type) && CLASSTYPE_TEMPLATE_INSTANTIATION (type))
    instantiate_class_template (TYPE_MAIN_VARIANT (type));
  return type;
}
tree complete_type ( tree type ) { if ( type == NULL_TREE ) return error_mark_node ; if ( type == error_mark_node || COMPLETE_TYPE_P ( type ) ) ; else if ( TREE_CODE ( type ) == ARRAY_TYPE && TYPE_DOMAIN ( type ) ) { tree t = complete_type ( TREE_TYPE ( type ) ) ; unsigned int needs_constructing , has_nontrivial_dtor ; if ( COMPLETE_TYPE_P ( t ) && ! dependent_type_p ( type ) ) layout_type ( type ) ; needs_constructing = TYPE_NEEDS_CONSTRUCTING ( TYPE_MAIN_VARIANT ( t ) ) ; has_nontrivial_dtor = TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( TYPE_MAIN_VARIANT ( t ) ) ; for ( t = TYPE_MAIN_VARIANT ( type ) ; t ; t = TYPE_NEXT_VARIANT ( t ) ) { TYPE_NEEDS_CONSTRUCTING ( t ) = needs_constructing ; TYPE_HAS_NONTRIVIAL_DESTRUCTOR ( t ) = has_nontrivial_dtor ; } } else if ( CLASS_TYPE_P ( type ) && CLASSTYPE_TEMPLATE_INSTANTIATION ( type ) ) instantiate_class_template ( TYPE_MAIN_VARIANT ( type ) ) ; return type ; }
Try to complete TYPE, if it is incomplete.
Try to complete TYPE if it is incomplete .
/* Rather than crash, we return something sure to cause an error
       at some point.  */