FreeBSD/contrib/gcc/cp/name-lookup.c
/* Add a function to the lookup structure.
   Returns true on error.  */
Add a function to the lookup structure.
Returns true on error.
Add a function to the lookup structure . Returns true on error .
static bool
add_function (struct arg_lookup *k, tree fn)
{
  if (!k->functions)
    k->functions = fn;
  else if (fn == k->functions)
    ;
  else if (is_overloaded_fn (k->functions) && is_overloaded_fn (fn))
    k->functions = build_overload (fn, k->functions);
  else
    {
      tree f1 = OVL_CURRENT (k->functions);
      tree f2 = fn;
      if (is_overloaded_fn (f1))
	{
	  fn = f1; f1 = f2; f2 = fn;
	}
      error ("%q+D is not a function,", f1);
      error ("  conflict with %q+D", f2);
      error ("  in call to %qD", k->name);
      return true;
    }
  return false;
}
static bool add_function ( struct arg_lookup * k , tree fn ) { if ( ! k -> functions ) k -> functions = fn ; else if ( fn == k -> functions ) ; else if ( is_overloaded_fn ( k -> functions ) && is_overloaded_fn ( fn ) ) k -> functions = build_overload ( fn , k -> functions ) ; else { tree f1 = OVL_CURRENT ( k -> functions ) ; tree f2 = fn ; if ( is_overloaded_fn ( f1 ) ) { fn = f1 ; f1 = f2 ; f2 = fn ; } error ( " " , f1 ) ; error ( " " , f2 ) ; error ( " " , k -> name ) ; return true ; } return false ; }
Add a function to the lookup structure.
Add a function to the lookup structure .
/* We used to check here to see if the function was already in the list,
     but that's O(n^2), which is just too expensive for function lookup.
     Now we deal with the occasional duplicate in joust.  In doing this, we
     assume that the number of duplicates will be small compared to the
     total number of functions being compared, which should usually be the
     case.  */ /* We must find only functions, or exactly one non-function.  */