contrib/gcc-4.4/gcc/cp/call.c
/* Add each of the viable functions in FNS (a FUNCTION_DECL or
   OVERLOAD) to the CANDIDATES, returning an updated list of
   CANDIDATES.  The ARGS are the arguments provided to the call,
   without any implicit object parameter.  The EXPLICIT_TARGS are
   explicit template arguments provided.  TEMPLATE_ONLY is true if
   only template functions should be considered.  CONVERSION_PATH,
   ACCESS_PATH, and FLAGS are as for add_function_candidate.  */
Add each of the viable functions in FNS (a FUNCTION_DECL or
OVERLOAD) to the CANDIDATES, returning an updated list of
CANDIDATES.  The ARGS are the arguments provided to the call,
without any implicit object parameter.  The EXPLICIT_TARGS are
explicit template arguments provided.  TEMPLATE_ONLY is true if
only template functions should be considered.
Add each of the viable functions in FNS ( a FUNCTION_DECL or OVERLOAD ) to the CANDIDATES returning an updated list of CANDIDATES . The ARGS are the arguments provided to the call without any implicit object parameter . The EXPLICIT_TARGS are explicit template arguments provided . TEMPLATE_ONLY is true if only template functions should be considered .
static void
add_candidates (tree fns, tree args,
		tree explicit_targs, bool template_only,
		tree conversion_path, tree access_path,
		int flags,
		struct z_candidate **candidates)
{
  tree ctype;
  tree non_static_args;
  ctype = conversion_path ? BINFO_TYPE (conversion_path) : NULL_TREE;
  non_static_args = NULL_TREE;
  while (fns)
    {
      tree fn;
      tree fn_args;
      fn = OVL_CURRENT (fns);
      if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
	{
	  if (!non_static_args)
	    non_static_args = tree_cons (NULL_TREE,
					 build_this (TREE_VALUE (args)),
					 TREE_CHAIN (args));
	  fn_args = non_static_args;
	}
      else
	fn_args = args;
      if (TREE_CODE (fn) == TEMPLATE_DECL)
	add_template_candidate (candidates,
				fn,
				ctype,
				explicit_targs,
				fn_args,
				NULL_TREE,
				access_path,
				conversion_path,
				flags,
				DEDUCE_CALL);
      else if (!template_only)
	add_function_candidate (candidates,
				fn,
				ctype,
				fn_args,
				access_path,
				conversion_path,
				flags);
      fns = OVL_NEXT (fns);
    }
}
static void add_candidates ( tree fns , tree args , tree explicit_targs , bool template_only , tree conversion_path , tree access_path , int flags , struct z_candidate * * candidates ) { tree ctype ; tree non_static_args ; ctype = conversion_path ? BINFO_TYPE ( conversion_path ) : NULL_TREE ; non_static_args = NULL_TREE ; while ( fns ) { tree fn ; tree fn_args ; fn = OVL_CURRENT ( fns ) ; if ( DECL_NONSTATIC_MEMBER_FUNCTION_P ( fn ) ) { if ( ! non_static_args ) non_static_args = tree_cons ( NULL_TREE , build_this ( TREE_VALUE ( args ) ) , TREE_CHAIN ( args ) ) ; fn_args = non_static_args ; } else fn_args = args ; if ( TREE_CODE ( fn ) == TEMPLATE_DECL ) add_template_candidate ( candidates , fn , ctype , explicit_targs , fn_args , NULL_TREE , access_path , conversion_path , flags , DEDUCE_CALL ) ; else if ( ! template_only ) add_function_candidate ( candidates , fn , ctype , fn_args , access_path , conversion_path , flags ) ; fns = OVL_NEXT ( fns ) ; } }
Add each of the viable functions in FNS (a FUNCTION_DECL or
OVERLOAD) to the CANDIDATES, returning an updated list of
CANDIDATES.
Add each of the viable functions in FNS ( a FUNCTION_DECL or OVERLOAD ) to the CANDIDATES returning an updated list of CANDIDATES .
/* Delay creating the implicit this parameter until it is needed.  */ /* Figure out which set of arguments to use.  */ /* If this function is a non-static member, prepend the implicit
	     object parameter.  */ /* Otherwise, just use the list of arguments provided.  */