]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/2294 (using declaration confusion)
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>
Tue, 16 Dec 2003 04:00:00 +0000 (04:00 +0000)
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>
Tue, 16 Dec 2003 04:00:00 +0000 (04:00 +0000)
PR c++/2294
* name-lookup.c (push_overloaded_decl): always construct an OVERLOAD
if the declaration comes from an using declaration.

From-SVN: r74667

gcc/cp/ChangeLog
gcc/cp/name-lookup.c

index 2c4b0526f4955ff13026dc64fea24c4f1989245f..f9de9054747b09db31a20bb46804d6cf09835516 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-16  Giovanni Bajo  <giovannibajo@gcc.gnu.org>\r
+\r
+       PR c++/2294\r
+       * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD\r
+       if the declaration comes from an using declaration.\r
+\r
 2003-12-15  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/10926
index ec8a63427c6d770bf045c0afabf2fc384765d41f..43c02cf72f313b5bb86696daf144790049b6fae0 100644 (file)
@@ -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));