diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8d5f0a12fd65a541bef3aed12085cac3bda2c2f5..f7e0022e38f8145c2f236c324f8deb8f4c5f67cc 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,14 @@ 2020-04-19 Jonathan Wakely <jwakely@redhat.com> + * 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 767f0d5797673294522dd954c5f0b7b0a8168623..ab1b1d5244235631a09a8203fcf1cd096dc8abe6 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<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> 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<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> 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<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> 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 9c2cd45be9c9b6d89ab284d36271d3e4506b2cc1..c9c9e9f38b771bdf7fa1aa840d74c601547f39a5 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<class _Value, class _Hash, class _Pred, class _Alloc> inline bool operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) { return !(__x == __y); } +#endif template<class _Value, class _Hash, class _Pred, class _Alloc> 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<class _Value, class _Hash, class _Pred, class _Alloc> 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 7be1d2ee95267f542056962c46e2535176a41125..17fbba3aadee674beceb1a8be6f6916f9d564c83 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<typename _Key, typename _Tp, typename _Hash, typename _Pred, typename _Alloc> 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<typename _Key, typename _Tp, @@ -1347,12 +1348,14 @@ namespace __debug const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { return __x._M_base() == __y._M_base(); } +#if __cpp_impl_three_way_comparison < 201907L template<typename _Key, typename _Tp, typename _Hash, typename _Pred, typename _Alloc> 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 9941bbe1c24f97daed56afae6da20a3b7a805555..4d30852186c1286d13846bdd09db33846c2dc17f 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<typename _Value, typename _Hash, typename _Pred, typename _Alloc> 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<typename _Value, @@ -1176,11 +1177,13 @@ namespace __debug const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) { return __x._M_base() == __y._M_base(); } +#if __cpp_impl_three_way_comparison < 201907L template<typename _Value, typename _Hash, typename _Pred, typename _Alloc> 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