aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin v. Löwis <loewis@informatik.hu-berlin.de>2000-05-22 07:23:26 +0000
committerMartin v. Löwis <loewis@gcc.gnu.org>2000-05-22 07:23:26 +0000
commitdd4fae800f833519d7ca17c2eefe31c862fa959b (patch)
tree34fc456110a6a3dd8226d5660223aedf1c317ea6 /gcc
parent13ffcdbbf68db0f53475204ceac3f26df6fa587e (diff)
downloadgcc-dd4fae800f833519d7ca17c2eefe31c862fa959b.zip
gcc-dd4fae800f833519d7ca17c2eefe31c862fa959b.tar.gz
gcc-dd4fae800f833519d7ca17c2eefe31c862fa959b.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c9
-rw-r--r--gcc/cp/decl2.c2
3 files changed, 14 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9f63976..2a5c755 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2000-05-22 Martin v. Löwis <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>
* cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Add sanity checks.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 236eb9e..6e80505 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4386,9 +4386,10 @@ push_class_level_binding (name, x)
}
}
-/* Insert another USING_DECL into the current binding level,
- returning this declaration. If this is a redeclaration,
- do nothing and return NULL_TREE. */
+/* Insert another USING_DECL into the current binding level, returning
+ this declaration. If this is a redeclaration, do nothing, and
+ return NULL_TREE if this not in namespace scope (in namespace
+ scope, a using decl might extend any previous bindings). */
tree
push_using_decl (scope, name)
@@ -4403,7 +4404,7 @@ push_using_decl (scope, name)
if (DECL_INITIAL (decl) == scope && DECL_NAME (decl) == name)
break;
if (decl)
- return NULL_TREE;
+ return namespace_bindings_p () ? decl : NULL_TREE;
decl = build_lang_decl (USING_DECL, name, void_type_node);
DECL_INITIAL (decl) = scope;
TREE_CHAIN (decl) = current_binding_level->usings;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index ad47f91..a8ab3fd 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4402,6 +4402,8 @@ qualified_lookup_using_namespace (name, scope, result, flags)
/* ... and a list of namespace yet to see. */
tree todo = NULL_TREE;
tree usings;
+ /* Look through namespace aliases. */
+ scope = ORIGINAL_NAMESPACE (scope);
while (scope && (result != error_mark_node))
{
seen = tree_cons (scope, NULL_TREE, seen);