aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-01-09 21:30:31 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2004-01-09 21:30:31 +0000
commitc404ab029db3cf2b4980ce2adfde67c3ee6252e0 (patch)
tree3d35383337edd3a450bf5a6e1c4c06c1e0c75389
parentbafb62a279780038d9a42d120496c7b0ab7b4734 (diff)
downloadgcc-c404ab029db3cf2b4980ce2adfde67c3ee6252e0.zip
gcc-c404ab029db3cf2b4980ce2adfde67c3ee6252e0.tar.gz
gcc-c404ab029db3cf2b4980ce2adfde67c3ee6252e0.tar.bz2
name-lookup.c (qualified_lookup_using_namespace): Consider strong using directives even if we've already found a binding.
* name-lookup.c (qualified_lookup_using_namespace): Consider strong using directives even if we've already found a binding. From-SVN: r75599
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/name-lookup.c23
2 files changed, 19 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0c4ab8c..bdbdd36 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * name-lookup.c (qualified_lookup_using_namespace): Consider
+ strong using directives even if we've already found a binding.
+
2004-01-09 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (cxx_expand_expr): Change prototype.
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index a788816..010bbe3 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -1,5 +1,5 @@
/* Definitions for C++ name lookup routines.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC.
@@ -3789,14 +3789,19 @@ qualified_lookup_using_namespace (tree name, tree scope, cxx_binding *result,
seen = tree_cons (scope, NULL_TREE, seen);
if (binding)
result = ambiguous_decl (name, result, binding, flags);
- if (!result->value && !result->type)
- /* Consider using directives. */
- for (usings = DECL_NAMESPACE_USING (scope); usings;
- usings = TREE_CHAIN (usings))
- /* If this was a real directive, and we have not seen it. */
- if (!TREE_INDIRECT_USING (usings)
- && !purpose_member (TREE_PURPOSE (usings), seen))
- todo = tree_cons (TREE_PURPOSE (usings), NULL_TREE, todo);
+
+ /* Consider strong using directives always, and non-strong ones
+ if we haven't found a binding yet. ??? Shouldn't we consider
+ non-strong ones if the initial RESULT is non-NULL, but the
+ binding in the given namespace is? */
+ for (usings = DECL_NAMESPACE_USING (scope); usings;
+ usings = TREE_CHAIN (usings))
+ /* If this was a real directive, and we have not seen it. */
+ if (!TREE_INDIRECT_USING (usings)
+ && ((!result->value && !result->type)
+ || is_associated_namespace (scope, TREE_PURPOSE (usings)))
+ && !purpose_member (TREE_PURPOSE (usings), seen))
+ todo = tree_cons (TREE_PURPOSE (usings), NULL_TREE, todo);
if (todo)
{
scope = TREE_PURPOSE (todo);