Commit 0c64a9ca by Jason Merrill Committed by Jason Merrill

decl.c (lookup_name_real): Pull out single function here.

	* decl.c (lookup_name_real): Pull out single function here.
	(select_decl): Not here.
	(unqualified_namespace_lookup): Use CP_DECL_CONTEXT.

From-SVN: r21268
parent f193b4b9
1998-07-17 Jason Merrill <jason@yorick.cygnus.com> 1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (lookup_name_real): Pull out single function here.
(select_decl): Not here.
(unqualified_namespace_lookup): Use CP_DECL_CONTEXT.
* decl.c (qualify_lookup): Tweak again. * decl.c (qualify_lookup): Tweak again.
* pt.c (lookup_template_class): Don't mess with the context of the * pt.c (lookup_template_class): Don't mess with the context of the
......
...@@ -4792,10 +4792,6 @@ select_decl (binding, flags) ...@@ -4792,10 +4792,6 @@ select_decl (binding, flags)
&& (!looking_for_template || TREE_CODE (val) != TEMPLATE_DECL)) && (!looking_for_template || TREE_CODE (val) != TEMPLATE_DECL))
val = NULL_TREE; val = NULL_TREE;
/* If we have a single function from a using decl, pull it out. */
if (val && TREE_CODE (val) == OVERLOAD && ! really_overloaded_fn (val))
val = OVL_FUNCTION (val);
return val; return val;
} }
...@@ -4848,9 +4844,7 @@ unqualified_namespace_lookup (name, flags) ...@@ -4848,9 +4844,7 @@ unqualified_namespace_lookup (name, flags)
val = select_decl (b, flags); val = select_decl (b, flags);
if (scope == global_namespace) if (scope == global_namespace)
break; break;
scope = DECL_CONTEXT (scope); scope = CP_DECL_CONTEXT (scope);
if (scope == NULL_TREE)
scope = global_namespace;
} }
return val; return val;
} }
...@@ -5102,6 +5096,10 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only) ...@@ -5102,6 +5096,10 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
val = TYPE_MAIN_DECL (IDENTIFIER_TYPE_VALUE (name)); val = TYPE_MAIN_DECL (IDENTIFIER_TYPE_VALUE (name));
else if (TREE_TYPE (val) == error_mark_node) else if (TREE_TYPE (val) == error_mark_node)
val = error_mark_node; val = error_mark_node;
/* If we have a single function from a using decl, pull it out. */
if (TREE_CODE (val) == OVERLOAD && ! really_overloaded_fn (val))
val = OVL_FUNCTION (val);
} }
else if (from_obj) else if (from_obj)
val = from_obj; val = from_obj;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment