Commit dd4fae80 by Martin v. Löwis Committed by Martin v. Löwis

decl2.c (qualified_lookup_using_namespace): Look through namespace aliases.

        * decl2.c (qualified_lookup_using_namespace): Look through
        namespace aliases.

        * decl.c (push_using_decl): Return the old decl on namespace level.

From-SVN: r34073
parent 13ffcdbb
2000-05-22 Martin v. Lwis <loewis@informatik.hu-berlin.de>
* decl2.c (qualified_lookup_using_namespace): Look through
namespace aliases.
* decl.c (push_using_decl): Return the old decl on namespace level.
2000-05-21 Mark Mitchell <mark@codesourcery.com> 2000-05-21 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Add sanity checks. * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Add sanity checks.
......
...@@ -4386,9 +4386,10 @@ push_class_level_binding (name, x) ...@@ -4386,9 +4386,10 @@ push_class_level_binding (name, x)
} }
} }
/* Insert another USING_DECL into the current binding level, /* Insert another USING_DECL into the current binding level, returning
returning this declaration. If this is a redeclaration, this declaration. If this is a redeclaration, do nothing, and
do nothing and return NULL_TREE. */ return NULL_TREE if this not in namespace scope (in namespace
scope, a using decl might extend any previous bindings). */
tree tree
push_using_decl (scope, name) push_using_decl (scope, name)
...@@ -4403,7 +4404,7 @@ push_using_decl (scope, name) ...@@ -4403,7 +4404,7 @@ push_using_decl (scope, name)
if (DECL_INITIAL (decl) == scope && DECL_NAME (decl) == name) if (DECL_INITIAL (decl) == scope && DECL_NAME (decl) == name)
break; break;
if (decl) if (decl)
return NULL_TREE; return namespace_bindings_p () ? decl : NULL_TREE;
decl = build_lang_decl (USING_DECL, name, void_type_node); decl = build_lang_decl (USING_DECL, name, void_type_node);
DECL_INITIAL (decl) = scope; DECL_INITIAL (decl) = scope;
TREE_CHAIN (decl) = current_binding_level->usings; TREE_CHAIN (decl) = current_binding_level->usings;
......
...@@ -4402,6 +4402,8 @@ qualified_lookup_using_namespace (name, scope, result, flags) ...@@ -4402,6 +4402,8 @@ qualified_lookup_using_namespace (name, scope, result, flags)
/* ... and a list of namespace yet to see. */ /* ... and a list of namespace yet to see. */
tree todo = NULL_TREE; tree todo = NULL_TREE;
tree usings; tree usings;
/* Look through namespace aliases. */
scope = ORIGINAL_NAMESPACE (scope);
while (scope && (result != error_mark_node)) while (scope && (result != error_mark_node))
{ {
seen = tree_cons (scope, NULL_TREE, seen); seen = tree_cons (scope, NULL_TREE, seen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment