FreeBSD/contrib/gcc/cp/name-lookup.c
/* Add functions of a namespace to the lookup structure.
   Returns true on error.  */
Add functions of a namespace to the lookup structure.
Returns true on error.
Add functions of a namespace to the lookup structure . Returns true on error .
static bool
arg_assoc_namespace (struct arg_lookup *k, tree scope)
{
  tree value;
  if (purpose_member (scope, k->namespaces))
    return 0;
  k->namespaces = tree_cons (scope, NULL_TREE, k->namespaces);
  for (value = DECL_NAMESPACE_ASSOCIATIONS (scope); value;
       value = TREE_CHAIN (value))
    if (arg_assoc_namespace (k, TREE_PURPOSE (value)))
      return true;
  value = namespace_binding (k->name, scope);
  if (!value)
    return false;
  for (; value; value = OVL_NEXT (value))
    {
      if (hidden_name_p (OVL_CURRENT (value)))
	{
	  tree args;
	  for (args = k->args; args; args = TREE_CHAIN (args))
	    if (friend_of_associated_class_p (TREE_VALUE (args),
					      OVL_CURRENT (value)))
	      break;
	  if (!args)
	    continue;
	}
      if (add_function (k, OVL_CURRENT (value)))
	return true;
    }
  return false;
}
static bool arg_assoc_namespace ( struct arg_lookup * k , tree scope ) { tree value ; if ( purpose_member ( scope , k -> namespaces ) ) return 0 ; k -> namespaces = tree_cons ( scope , NULL_TREE , k -> namespaces ) ; for ( value = DECL_NAMESPACE_ASSOCIATIONS ( scope ) ; value ; value = TREE_CHAIN ( value ) ) if ( arg_assoc_namespace ( k , TREE_PURPOSE ( value ) ) ) return true ; value = namespace_binding ( k -> name , scope ) ; if ( ! value ) return false ; for ( ; value ; value = OVL_NEXT ( value ) ) { if ( hidden_name_p ( OVL_CURRENT ( value ) ) ) { tree args ; for ( args = k -> args ; args ; args = TREE_CHAIN ( args ) ) if ( friend_of_associated_class_p ( TREE_VALUE ( args ) , OVL_CURRENT ( value ) ) ) break ; if ( ! args ) continue ; } if ( add_function ( k , OVL_CURRENT ( value ) ) ) return true ; } return false ; }
Add functions of a namespace to the lookup structure.
Add functions of a namespace to the lookup structure .
/* Check out our super-users.  */ /* We don't want to find arbitrary hidden functions via argument
	 dependent lookup.  We only want to find friends of associated
	 classes.  */