From: Giovanni Bajo Date: Sat, 27 Dec 2003 00:05:55 +0000 (+0000) Subject: backport: re PR c++/2294 (using declaration confusion) X-Git-Tag: releases/gcc-3.3.3~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2f34b802fdfe039df8d77802daf091661ad270a;p=thirdparty%2Fgcc.git backport: re PR c++/2294 (using declaration confusion) Backport from mainline. 2003-12-16 Giovanni Bajo PR c++/2294 * decl.c (push_overloaded_decl): always construct an OVERLOAD if the declaration comes from an using declaration. From-SVN: r75045 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bc456189b514..6949ed133dab 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2003-12-27 Giovanni Bajo + + Backport from mainline: + 2003-12-16 Giovanni Bajo + + PR c++/2294 + * decl.c (push_overloaded_decl): always construct an OVERLOAD + if the declaration comes from an using declaration. + 2003-12-26 Gabriel Dos Reis Backport from mainline: diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 48de213b73d6..504101da3736 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4918,7 +4918,11 @@ push_overloaded_decl (decl, 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));