* name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
authorNathan Sidwell <nathan@acm.org>
Wed, 11 Jan 2017 20:11:56 +0000 (20:11 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 11 Jan 2017 20:11:56 +0000 (20:11 +0000)
From-SVN: r244334

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

index 6ae85ae6c7d034b961da634c5050da9a0dfccb9b..a6a8e8b7ff473fe2bf14829193dc4f34faa8d5c1 100644 (file)
@@ -1,3 +1,7 @@
+2017-01-11  Nathan Sidwell  <nathan@acm.org>
+
+       * name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
+
 2017-01-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/78341
index c422d2f0ac2c2c46c64e07aaa49420bdad74da95..ba900cbf01fceb55c23070b3c76109d1ab46eb37 100644 (file)
@@ -2454,9 +2454,11 @@ push_overloaded_decl_1 (tree decl, int flags, bool is_friend)
       || (flags & PUSH_USING))
     {
       if (old && TREE_CODE (old) != OVERLOAD)
-       new_binding = ovl_cons (decl, ovl_cons (old, NULL_TREE));
+       /* Wrap the existing single decl in an overload.  */
+       new_binding = ovl_cons (old, NULL_TREE);
       else
-       new_binding = ovl_cons (decl, old);
+       new_binding = old;
+      new_binding = ovl_cons (decl, new_binding);
       if (flags & PUSH_USING)
        OVL_USED (new_binding) = 1;
     }