summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-07-18 02:26:44 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1998-07-18 02:26:44 +0000
commit0267fd32c69cee65b5d7b87cefbab213f6e2809c (patch)
treed04d91d44d59712021c27b92fdddecee31324ea4
parentd0b1d1a7570f2929f3047ef6e8a86f4e5d632908 (diff)
downloadgcc-0267fd32c69cee65b5d7b87cefbab213f6e2809c.tar.gz
* decl.c (lookup_name_real): Pull out single function here.
(select_decl): Not here. (unqualified_namespace_lookup): Use CP_DECL_CONTEXT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21268 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c12
2 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6562ef6dae0..5a3699df76c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
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.
* pt.c (lookup_template_class): Don't mess with the context of the
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 113f23038a3..913b9abd00a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4792,10 +4792,6 @@ select_decl (binding, flags)
&& (!looking_for_template || TREE_CODE (val) != TEMPLATE_DECL))
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;
}
@@ -4848,9 +4844,7 @@ unqualified_namespace_lookup (name, flags)
val = select_decl (b, flags);
if (scope == global_namespace)
break;
- scope = DECL_CONTEXT (scope);
- if (scope == NULL_TREE)
- scope = global_namespace;
+ scope = CP_DECL_CONTEXT (scope);
}
return val;
}
@@ -5102,6 +5096,10 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
val = TYPE_MAIN_DECL (IDENTIFIER_TYPE_VALUE (name));
else if (TREE_TYPE (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)
val = from_obj;