summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-17 15:43:30 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-17 15:43:30 +0000
commitbf5d595fbab82940222bd2a16b1482f67c124c36 (patch)
tree74249027425a05d4e072007fdacc7b47ddde3629 /gcc/cp
parentf0806d8b859e0e4660a211da84d01b116a61bc3b (diff)
downloadgcc-bf5d595fbab82940222bd2a16b1482f67c124c36.tar.gz
* name-lookup.c (lookup_namespace_name): Remove.
* name-lookup.h: Remove the prototype for lookup_namespace_name. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109821 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/name-lookup.c78
-rw-r--r--gcc/cp/name-lookup.h1
3 files changed, 6 insertions, 79 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 77bb00b61cc..1f26299ee03 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-17 Kazu Hirata <kazu@codesourcery.com>
+
+ * name-lookup.c (lookup_namespace_name): Remove.
+ * name-lookup.h: Remove the prototype for
+ lookup_namespace_name.
+
2006-01-17 Jakub Jelinek <jakub@redhat.com>
PR c/25682
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 2d204a76c84..4a6c627a728 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3521,84 +3521,6 @@ remove_hidden_names (tree fns)
return fns;
}
-/* Look up NAME in the NAMESPACE. */
-
-tree
-lookup_namespace_name (tree namespace, tree name)
-{
- tree val;
- tree template_id = NULL_TREE;
- struct scope_binding binding = EMPTY_SCOPE_BINDING;
-
- timevar_push (TV_NAME_LOOKUP);
- gcc_assert (TREE_CODE (namespace) == NAMESPACE_DECL);
-
- if (TREE_CODE (name) == NAMESPACE_DECL)
- /* This happens for A::B<int> when B is a namespace. */
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, name);
- else if (TREE_CODE (name) == TEMPLATE_DECL)
- {
- /* This happens for A::B where B is a template, and there are no
- template arguments. */
- error ("invalid use of %qD", name);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
- }
-
- namespace = ORIGINAL_NAMESPACE (namespace);
-
- if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
- {
- template_id = name;
- name = TREE_OPERAND (name, 0);
- if (TREE_CODE (name) == OVERLOAD)
- name = DECL_NAME (OVL_CURRENT (name));
- else if (DECL_P (name))
- name = DECL_NAME (name);
- }
-
- gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
-
- if (!qualified_lookup_using_namespace (name, namespace, &binding, 0))
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
-
- if (binding.value)
- {
- val = binding.value;
-
- if (template_id)
- {
- if (DECL_CLASS_TEMPLATE_P (val))
- val = lookup_template_class (val,
- TREE_OPERAND (template_id, 1),
- /*in_decl=*/NULL_TREE,
- /*context=*/NULL_TREE,
- /*entering_scope=*/0,
- tf_error | tf_warning);
- else if (DECL_FUNCTION_TEMPLATE_P (val)
- || TREE_CODE (val) == OVERLOAD)
- val = lookup_template_function (val,
- TREE_OPERAND (template_id, 1));
- else
- {
- error ("%<%D::%D%> is not a template", namespace, name);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, 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);
-
- /* Ignore built-in functions and friends that haven't been declared
- yet. */
- if (!val || !hidden_name_p (val))
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, val);
- }
-
- error ("%qD undeclared in namespace %qD", name, namespace);
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
-}
-
/* Select the right _DECL from multiple choices. */
static tree
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index 5a1dc8e34f5..12cb697f32b 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -319,7 +319,6 @@ extern tree namespace_binding (tree, tree);
extern void set_namespace_binding (tree, tree, tree);
extern bool hidden_name_p (tree);
extern tree remove_hidden_names (tree);
-extern tree lookup_namespace_name (tree, tree);
extern tree lookup_qualified_name (tree, tree, bool, bool);
extern tree lookup_name_nonclass (tree);
extern tree lookup_function_nonclass (tree, tree, bool);