aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2003-03-30 16:00:39 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2003-03-30 16:00:39 +0000
commited3cf9539b38d56097601dd56acd1433931ed603 (patch)
treec2091d7753669f96b0193d11c08e165c9103f777 /gcc/cp/decl2.c
parent9a8075a164b4bd63e39b7ab3bda9d1958187f3c5 (diff)
downloadgcc-ed3cf9539b38d56097601dd56acd1433931ed603.zip
gcc-ed3cf9539b38d56097601dd56acd1433931ed603.tar.gz
gcc-ed3cf9539b38d56097601dd56acd1433931ed603.tar.bz2
cp-tree.h (binding_for_name): Move to name-lookup.h Adjust prototype.
* cp-tree.h (binding_for_name: Move to name-lookup.h Adjust prototype. (cxx_scope_find_binding_for_name): Likewise. * decl.c (find_binding: Move to name-lookup.c. (binding_for_name): Likewise. (cxx_scope_find_binding_for_name): Likewise. (BINDING_LEVEL): Remove. (push_binding): Tidy. (push_class_binding): Likewise. (pop_binding): Likewise. (poplevel): Likewise. (poplevel_class): Likewise. (set_identifier_type_value_with_scope): Likewise. (push_overloaded_decl): Likewise. (lookup_tag): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_name_current_level): Likewise. (maybe_inject_for_scope_var): Likewise. (namespace_binding): Move to name-lookup.c. (set_namespace_binding): Likewise. * decl2.c (lookup_using_namespace): Tidy. (qualified_lookup_using_namespace): Likewise. (do_toplevel_using_decl): Likewise. * name-lookup.c: Include "timevar.h" * name-lookup.h (cxx_scope): Declare. (struct cxx_binding): Lose member "has_level". Adjust "scope" member declaration. (BINDING_SCOPE): Adjust definition. (BINDING_HAS_LEVEL_P): Remove. From-SVN: r65044
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 88545d4..b7b0054 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3632,10 +3632,11 @@ lookup_using_namespace (tree name, cxx_binding *val, tree usings, tree scope,
for (iter = usings; iter; iter = TREE_CHAIN (iter))
if (TREE_VALUE (iter) == scope)
{
+ tree used = ORIGINAL_NAMESPACE (TREE_PURPOSE (iter));
cxx_binding *val1 =
- cxx_scope_find_binding_for_name (TREE_PURPOSE (iter), name);
+ cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (used), name);
if (spacesp)
- *spacesp = tree_cons (TREE_PURPOSE (iter), NULL_TREE, *spacesp);
+ *spacesp = tree_cons (used, NULL_TREE, *spacesp);
/* Resolve ambiguities. */
if (val1)
val = ambiguous_decl (name, val, val1, flags);
@@ -3663,7 +3664,8 @@ qualified_lookup_using_namespace (tree name, tree scope, cxx_binding *result,
scope = ORIGINAL_NAMESPACE (scope);
while (scope && result->value != error_mark_node)
{
- cxx_binding *binding = cxx_scope_find_binding_for_name (scope, name);
+ cxx_binding *binding =
+ cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
seen = tree_cons (scope, NULL_TREE, seen);
if (binding)
result = ambiguous_decl (name, result, binding, flags);
@@ -4355,7 +4357,7 @@ do_toplevel_using_decl (tree decl)
if (decl == NULL_TREE)
return;
- binding = binding_for_name (name, current_namespace);
+ binding = binding_for_name (NAMESPACE_LEVEL (current_namespace), name);
oldval = BINDING_VALUE (binding);
oldtype = BINDING_TYPE (binding);