FreeBSD/contrib/gcc/cp/call.c
/* Return an expression for a call to FN (a namespace-scope function,
   or a static member function) with the ARGS.  */
Return an expression for a call to FN (a namespace-scope function,
or a static member function) with the ARGS.
Return an expression for a call to FN ( a namespace - scope function or a static member function ) with the ARGS .
tree
build_new_function_call (tree fn, tree args, bool koenig_p)
{
  struct z_candidate *candidates, *cand;
  bool any_viable_p;
  void *p;
  tree result;
  args = resolve_args (args);
  if (args == error_mark_node)
    return error_mark_node;
  if (!koenig_p)
    {
      tree orig_fn = fn;
      fn = remove_hidden_names (fn);
      if (!fn)
	{
	  error ("no matching function for call to %<%D(%A)%>",
		 DECL_NAME (OVL_CURRENT (orig_fn)), args);
	  return error_mark_node;
	}
    }
  p = conversion_obstack_alloc (0);
  cand = perform_overload_resolution (fn, args, &candidates, &any_viable_p);
  if (!cand)
    {
      if (!any_viable_p && candidates && ! candidates->next)
	return build_function_call (candidates->fn, args);
      if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
	fn = TREE_OPERAND (fn, 0);
      if (!any_viable_p)
	error ("no matching function for call to %<%D(%A)%>",
	       DECL_NAME (OVL_CURRENT (fn)), args);
      else
	error ("call of overloaded %<%D(%A)%> is ambiguous",
	       DECL_NAME (OVL_CURRENT (fn)), args);
      if (candidates)
	print_z_candidates (candidates);
      result = error_mark_node;
    }
  else
    result = build_over_call (cand, LOOKUP_NORMAL);
  obstack_free (&conversion_obstack, p);
  return result;
}
tree build_new_function_call ( tree fn , tree args , bool koenig_p ) { struct z_candidate * candidates , * cand ; bool any_viable_p ; void * p ; tree result ; args = resolve_args ( args ) ; if ( args == error_mark_node ) return error_mark_node ; if ( ! koenig_p ) { tree orig_fn = fn ; fn = remove_hidden_names ( fn ) ; if ( ! fn ) { error ( " " , DECL_NAME ( OVL_CURRENT ( orig_fn ) ) , args ) ; return error_mark_node ; } } p = conversion_obstack_alloc ( 0 ) ; cand = perform_overload_resolution ( fn , args , & candidates , & any_viable_p ) ; if ( ! cand ) { if ( ! any_viable_p && candidates && ! candidates -> next ) return build_function_call ( candidates -> fn , args ) ; if ( TREE_CODE ( fn ) == TEMPLATE_ID_EXPR ) fn = TREE_OPERAND ( fn , 0 ) ; if ( ! any_viable_p ) error ( " " , DECL_NAME ( OVL_CURRENT ( fn ) ) , args ) ; else error ( " " , DECL_NAME ( OVL_CURRENT ( fn ) ) , args ) ; if ( candidates ) print_z_candidates ( candidates ) ; result = error_mark_node ; } else result = build_over_call ( cand , LOOKUP_NORMAL ) ; obstack_free ( & conversion_obstack , p ) ; return result ; }
Return an expression for a call to FN (a namespace-scope function,
or a static member function) with the ARGS.
Return an expression for a call to FN ( a namespace - scope function or a static member function ) with the ARGS .
/* If this function was found without using argument dependent
     lookup, then we want to ignore any undeclared friend
     functions.  */ /* Get the high-water mark for the CONVERSION_OBSTACK.  */ /* Free all the conversions we allocated.  */