FreeBSD/contrib/gcc/cp/name-lookup.c
/* Look up NAME (an IDENTIFIER_NODE) in SCOPE (either a NAMESPACE_DECL
   or a class TYPE).  If IS_TYPE_P is TRUE, then ignore non-type
   bindings.

   Returns a DECL (or OVERLOAD, or BASELINK) representing the
   declaration found.  If no suitable declaration can be found,
   ERROR_MARK_NODE is returned.  If COMPLAIN is true and SCOPE is
   neither a class-type nor a namespace a diagnostic is issued.  */
Look up NAME (an IDENTIFIER_NODE) in SCOPE (either a NAMESPACE_DECL
or a class TYPE).  If IS_TYPE_P is TRUE, then ignore non-type
bindings.

Returns a DECL (or OVERLOAD, or BASELINK) representing the
declaration found.  If no suitable declaration can be found,
ERROR_MARK_NODE is returned.  If COMPLAIN is true and SCOPE is
neither a class-type nor a namespace a diagnostic is issued.
Look up NAME ( an IDENTIFIER_NODE ) in SCOPE ( either a NAMESPACE_DECL or a class TYPE ) . If IS_TYPE_P is TRUE then ignore non - type bindings . Returns a DECL ( or OVERLOAD or BASELINK ) representing the declaration found . If no suitable declaration can be found ERROR_MARK_NODE is returned . If COMPLAIN is true and SCOPE is neither a class - type nor a namespace a diagnostic is issued .
tree
lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain)
{
  int flags = 0;
  tree t = NULL_TREE;
  if (TREE_CODE (scope) == NAMESPACE_DECL)
    {
      struct scope_binding binding = EMPTY_SCOPE_BINDING;
      flags |= LOOKUP_COMPLAIN;
      if (is_type_p)
	flags |= LOOKUP_PREFER_TYPES;
      if (qualified_lookup_using_namespace (name, scope, &binding, flags))
	t = binding.value;
    }
  else if (is_aggr_type (scope, complain))
    t = lookup_member (scope, name, 2, is_type_p);
  if (!t)
    return error_mark_node;
  return t;
}
tree lookup_qualified_name ( tree scope , tree name , bool is_type_p , bool complain ) { int flags = 0 ; tree t = NULL_TREE ; if ( TREE_CODE ( scope ) == NAMESPACE_DECL ) { struct scope_binding binding = EMPTY_SCOPE_BINDING ; flags |= LOOKUP_COMPLAIN ; if ( is_type_p ) flags |= LOOKUP_PREFER_TYPES ; if ( qualified_lookup_using_namespace ( name , scope , & binding , flags ) ) t = binding . value ; } else if ( is_aggr_type ( scope , complain ) ) t = lookup_member ( scope , name , 2 , is_type_p ) ; if ( ! t ) return error_mark_node ; return t ; }
Look up NAME (an IDENTIFIER_NODE) in SCOPE (either a NAMESPACE_DECL
or a class TYPE).
Look up NAME ( an IDENTIFIER_NODE ) in SCOPE ( either a NAMESPACE_DECL or a class TYPE ) .