diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2003-12-16 04:00:00 +0000 |
---|---|---|
committer | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2003-12-16 04:00:00 +0000 |
commit | f31620006c00d5c77ad4ba522936e31725b64786 (patch) | |
tree | 3f40f0e003a90038669a4d0e454661eb3682f37b | |
parent | 75e0d03a94c1b3a24717e0c2f1241ee3d77c3259 (diff) | |
download | gcc-f31620006c00d5c77ad4ba522936e31725b64786.zip gcc-f31620006c00d5c77ad4ba522936e31725b64786.tar.gz gcc-f31620006c00d5c77ad4ba522936e31725b64786.tar.bz2 |
re PR c++/2294 (using declaration confusion)
PR c++/2294
* name-lookup.c (push_overloaded_decl): always construct an OVERLOAD
if the declaration comes from an using declaration.
From-SVN: r74667
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2c4b052..f9de905 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2003-12-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/2294
+ * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD
+ if the declaration comes from an using declaration.
+
2003-12-15 Mark Mitchell <mark@codesourcery.com> PR c++/10926 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index ec8a634..43c02cf 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2006,7 +2006,11 @@ push_overloaded_decl (tree decl, int flags) } } - if (old || TREE_CODE (decl) == TEMPLATE_DECL) + if (old || TREE_CODE (decl) == TEMPLATE_DECL + /* If it's a using declaration, we always need to build an OVERLOAD, + because it's the only way to remember that the declaration comes + from 'using', and have the lookup behave correctly. */ + || (flags & PUSH_USING)) { if (old && TREE_CODE (old) != OVERLOAD) new_binding = ovl_cons (decl, ovl_cons (old, NULL_TREE)); |