]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/2294 (using declaration confusion)
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Sat, 27 Dec 2003 00:05:55 +0000 (00:05 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Sat, 27 Dec 2003 00:05:55 +0000 (00:05 +0000)
        Backport from mainline.

        2003-12-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>

        PR c++/2294
        * decl.c (push_overloaded_decl): always construct an OVERLOAD
        if the declaration comes from an using declaration.

From-SVN: r75045

gcc/cp/ChangeLog
gcc/cp/decl.c

index bc456189b51426d5040f296bcf4afd93cba7980e..6949ed133dab431c80b9cf9bbd79c3470e54c420 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-27  Giovanni Bajo  <giovannibajo@gcc.gnu.org>\r
+\r
+       Backport from mainline:\r
+       2003-12-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>\r
+\r
+       PR c++/2294\r
+       * decl.c (push_overloaded_decl): always construct an OVERLOAD\r
+       if the declaration comes from an using declaration.\r
+
 2003-12-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        Backport from mainline:
index 48de213b73d699337fcd6e7023b497a57530478a..504101da3736ec5ed393bd9ab28c926e7d2ed25f 100644 (file)
@@ -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,\r
+        because it's the only way to remember that the declaration comes\r
+        from 'using', and have the lookup behave correctly.  */\r
+      || (flags & PUSH_USING))\r
     {
       if (old && TREE_CODE (old) != OVERLOAD)
        new_binding = ovl_cons (decl, ovl_cons (old, NULL_TREE));