aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2006-01-17 15:43:30 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2006-01-17 15:43:30 +0000
commitdd7d8d710d4efa414aec92cf82a939ebf51f7359 (patch)
tree74249027425a05d4e072007fdacc7b47ddde3629
parent84af16a69c896a55c013f09edd756438dc990bb6 (diff)
downloadgcc-dd7d8d710d4efa414aec92cf82a939ebf51f7359.zip
gcc-dd7d8d710d4efa414aec92cf82a939ebf51f7359.tar.gz
gcc-dd7d8d710d4efa414aec92cf82a939ebf51f7359.tar.bz2
name-lookup.c (lookup_namespace_name): Remove.
* name-lookup.c (lookup_namespace_name): Remove. * name-lookup.h: Remove the prototype for lookup_namespace_name. From-SVN: r109821
-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 77bb00b..1f26299 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 2d204a7..4a6c627 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 5a1dc8e..12cb697 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);