FreeBSD/contrib/gcc/cp/decl.c
/* We're defining DECL.  Make sure that it's type is OK.  */
We're defining DECL.  Make sure that it's type is OK.
We ' re defining DECL . Make sure that it ' s type is OK .
static void
check_function_type (tree decl, tree current_function_parms)
{
  tree fntype = TREE_TYPE (decl);
  tree return_type = complete_type (TREE_TYPE (fntype));
  require_complete_types_for_parms (current_function_parms);
  if (dependent_type_p (return_type))
    return;
  if (!COMPLETE_OR_VOID_TYPE_P (return_type))
    {
      tree args = TYPE_ARG_TYPES (fntype);
      error ("return type %q#T is incomplete", return_type);
      if (TREE_CODE (fntype) == METHOD_TYPE)
	fntype = build_method_type_directly (TREE_TYPE (TREE_VALUE (args)),
					     void_type_node,
					     TREE_CHAIN (args));
      else
	fntype = build_function_type (void_type_node, args);
      TREE_TYPE (decl)
	= build_exception_variant (fntype,
				   TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl)));
    }
  else
    abstract_virtuals_error (decl, TREE_TYPE (fntype));
}
static void check_function_type ( tree decl , tree current_function_parms ) { tree fntype = TREE_TYPE ( decl ) ; tree return_type = complete_type ( TREE_TYPE ( fntype ) ) ; require_complete_types_for_parms ( current_function_parms ) ; if ( dependent_type_p ( return_type ) ) return ; if ( ! COMPLETE_OR_VOID_TYPE_P ( return_type ) ) { tree args = TYPE_ARG_TYPES ( fntype ) ; error ( " " , return_type ) ; if ( TREE_CODE ( fntype ) == METHOD_TYPE ) fntype = build_method_type_directly ( TREE_TYPE ( TREE_VALUE ( args ) ) , void_type_node , TREE_CHAIN ( args ) ) ; else fntype = build_function_type ( void_type_node , args ) ; TREE_TYPE ( decl ) = build_exception_variant ( fntype , TYPE_RAISES_EXCEPTIONS ( TREE_TYPE ( decl ) ) ) ; } else abstract_virtuals_error ( decl , TREE_TYPE ( fntype ) ) ; }
We're defining DECL.
We ' re defining DECL .
/* In a function definition, arg types must be complete.  */ /* Make it return void instead.  */