mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 14:01:04 +08:00
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
This commit is contained in:
parent
84af16a69c
commit
dd7d8d710d
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user