diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-01-11 20:11:56 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-01-11 20:11:56 +0000 |
commit | 5b33cc835cfb82fee4508129bf849f40733e752f (patch) | |
tree | 4d20bc825f0043bf7509a9ea830d5b1e9f3bf501 /gcc | |
parent | eae63d784c503ad7954ac8ae28232aec635ac7fc (diff) | |
download | gcc-5b33cc835cfb82fee4508129bf849f40733e752f.zip gcc-5b33cc835cfb82fee4508129bf849f40733e752f.tar.gz gcc-5b33cc835cfb82fee4508129bf849f40733e752f.tar.bz2 |
* name-lookup.c (push_overloaded_decl_1): Refactor OVERLOAD creation.
From-SVN: r244334
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6ae85ae..a6a8e8b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index c422d2f..ba900cb 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -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; } |