FreeBSD/contrib/gcc/cp/name-lookup.c
/* Adds everything associated with class to the lookup structure.
   Returns true on error.  */
Adds everything associated with class to the lookup structure.
Returns true on error.
Adds everything associated with class to the lookup structure . Returns true on error .
static bool
arg_assoc_class (struct arg_lookup *k, tree type)
{
  tree list, friends, context;
  int i;
  if (!CLASS_TYPE_P (type))
    return false;
  if (purpose_member (type, k->classes))
    return false;
  k->classes = tree_cons (type, NULL_TREE, k->classes);
  context = decl_namespace_context (type);
  if (arg_assoc_namespace (k, context))
    return true;
  if (TYPE_BINFO (type))
    {
      tree binfo, base_binfo;
      for (binfo = TYPE_BINFO (type), i = 0;
	   BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
	if (arg_assoc_class (k, BINFO_TYPE (base_binfo)))
	  return true;
    }
  for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list;
       list = TREE_CHAIN (list))
    if (k->name == FRIEND_NAME (list))
      for (friends = FRIEND_DECLS (list); friends;
	   friends = TREE_CHAIN (friends))
	{
	  tree fn = TREE_VALUE (friends);
	  if (CP_DECL_CONTEXT (fn) != context)
	    continue;
	  if (TREE_CODE (fn) == FUNCTION_DECL && DECL_USE_TEMPLATE (fn))
	    continue;
	  if (add_function (k, fn))
	    return true;
	}
  if (CLASSTYPE_TEMPLATE_INFO (type)
      && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type)))
    {
      list = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type));
      for (i = 0; i < TREE_VEC_LENGTH (list); ++i)
	arg_assoc_template_arg (k, TREE_VEC_ELT (list, i));
    }
  return false;
}
static bool arg_assoc_class ( struct arg_lookup * k , tree type ) { tree list , friends , context ; int i ; if ( ! CLASS_TYPE_P ( type ) ) return false ; if ( purpose_member ( type , k -> classes ) ) return false ; k -> classes = tree_cons ( type , NULL_TREE , k -> classes ) ; context = decl_namespace_context ( type ) ; if ( arg_assoc_namespace ( k , context ) ) return true ; if ( TYPE_BINFO ( type ) ) { tree binfo , base_binfo ; for ( binfo = TYPE_BINFO ( type ) , i = 0 ; BINFO_BASE_ITERATE ( binfo , i , base_binfo ) ; i ++ ) if ( arg_assoc_class ( k , BINFO_TYPE ( base_binfo ) ) ) return true ; } for ( list = DECL_FRIENDLIST ( TYPE_MAIN_DECL ( type ) ) ; list ; list = TREE_CHAIN ( list ) ) if ( k -> name == FRIEND_NAME ( list ) ) for ( friends = FRIEND_DECLS ( list ) ; friends ; friends = TREE_CHAIN ( friends ) ) { tree fn = TREE_VALUE ( friends ) ; if ( CP_DECL_CONTEXT ( fn ) != context ) continue ; if ( TREE_CODE ( fn ) == FUNCTION_DECL && DECL_USE_TEMPLATE ( fn ) ) continue ; if ( add_function ( k , fn ) ) return true ; } if ( CLASSTYPE_TEMPLATE_INFO ( type ) && PRIMARY_TEMPLATE_P ( CLASSTYPE_TI_TEMPLATE ( type ) ) ) { list = INNERMOST_TEMPLATE_ARGS ( CLASSTYPE_TI_ARGS ( type ) ) ; for ( i = 0 ; i < TREE_VEC_LENGTH ( list ) ; ++ i ) arg_assoc_template_arg ( k , TREE_VEC_ELT ( list , i ) ) ; } return false ; }
Adds everything associated with class to the lookup structure.
Adds everything associated with class to the lookup structure .
/* Backend build structures, such as __builtin_va_list, aren't
     affected by all this.  */ /* Process baseclasses.  */ /* Process friends.  */ /* Only interested in global functions with potentially hidden
	     (i.e. unqualified) declarations.  */ /* Template specializations are never found by name lookup.
	     (Templates themselves can be found, but not template
	     specializations.)  */ /* Process template arguments.  */