From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1984) id 9D5E53AA981F; Fri, 17 Jul 2020 14:44:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D5E53AA981F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594997062; bh=KC61r/sorDBojZY9Za2hUOWN2iNTUzlAhoDbe30W/+A=; h=From:To:Subject:Date:From; b=F1lAaxb6FNDO2jPEuNfWUYyLbS+cHFBwR0Bficjx+kf55mp1rc2hV6ALIzMHBnuwj QHjqgCiR5Pffi1rjyWLChVOOjBaBA0HF1VJTeLV4GMP6dNBzYC/K4CrIy4tYv7fAWQ zFuKdRhcS16vxJrEA+xqGfDyxk+U+scr3JcXMlmc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tamar Christina To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/arm-perf-staging)] libstdc++: Remove operator!= overloads for unordered containers X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/vendors/ARM/heads/arm-perf-staging X-Git-Oldrev: a2c0fa35d0dc8912b0c1a658234221de61e60840 X-Git-Newrev: 7ab9c2430ffb13de8433aa7d654192b5d2b1e7a9 Message-Id: <20200717144422.9D5E53AA981F@sourceware.org> Date: Fri, 17 Jul 2020 14:44:22 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 14:44:22 -0000 https://gcc.gnu.org/g:7ab9c2430ffb13de8433aa7d654192b5d2b1e7a9 commit 7ab9c2430ffb13de8433aa7d654192b5d2b1e7a9 Author: Jonathan Wakely Date: Sun Apr 19 21:04:40 2020 +0100 libstdc++: Remove operator!= overloads for unordered containers Some more C++20 changes from P1614R2, "The Mothership has Landed". * include/bits/unordered_map.h (unordered_map, unordered_multimap): Remove redundant operator!= for C++20. * include/bits/unordered_set.h (unordered_set, unordered_multiset): Likewise. * include/debug/unordered_map (unordered_map, unordered_multimap): Likewise. * include/debug/unordered_set (unordered_set, unordered_multiset): Likewise. Diff: --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/bits/unordered_map.h | 4 ++++ libstdc++-v3/include/bits/unordered_set.h | 4 ++++ libstdc++-v3/include/debug/unordered_map | 5 ++++- libstdc++-v3/include/debug/unordered_set | 5 ++++- 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8d5f0a12fd6..f7e0022e38f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,14 @@ 2020-04-19 Jonathan Wakely + * include/bits/unordered_map.h (unordered_map, unordered_multimap): + Remove redundant operator!= for C++20. + * include/bits/unordered_set.h (unordered_set, unordered_multiset): + Likewise. + * include/debug/unordered_map (unordered_map, unordered_multimap): + Likewise. + * include/debug/unordered_set (unordered_set, unordered_multiset): + Likewise. + PR other/94629 * include/debug/formatter.h (_Error_formatter::_Parameter): Fix redundant assignment in constructor. diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h index 767f0d57976..ab1b1d52442 100644 --- a/libstdc++-v3/include/bits/unordered_map.h +++ b/libstdc++-v3/include/bits/unordered_map.h @@ -2092,11 +2092,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return __x._M_h._M_equal(__y._M_h); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } +#endif template inline bool @@ -2104,11 +2106,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return __x._M_h._M_equal(__y._M_h); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } +#endif _GLIBCXX_END_NAMESPACE_CONTAINER diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h index 9c2cd45be9c..c9c9e9f38b7 100644 --- a/libstdc++-v3/include/bits/unordered_set.h +++ b/libstdc++-v3/include/bits/unordered_set.h @@ -1704,11 +1704,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) { return __x._M_h._M_equal(__y._M_h); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } +#endif template inline bool @@ -1716,11 +1718,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) { return __x._M_h._M_equal(__y._M_h); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } +#endif _GLIBCXX_END_NAMESPACE_CONTAINER diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 7be1d2ee952..17fbba3aade 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -741,13 +741,14 @@ namespace __debug const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return __x._M_base() == __y._M_base(); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } - +#endif /// Class std::unordered_multimap with safety/checking/debug instrumentation. template& __y) { return __x._M_base() == __y._M_base(); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } +#endif } // namespace __debug } // namespace std diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 9941bbe1c24..4d30852186c 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -612,12 +612,13 @@ namespace __debug const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) { return __x._M_base() == __y._M_base(); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } - +#endif /// Class std::unordered_multiset with safety/checking/debug instrumentation. template& __y) { return __x._M_base() == __y._M_base(); } +#if __cpp_impl_three_way_comparison < 201907L template inline bool operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } +#endif } // namespace __debug } // namespace std