From d37303d15af7ff6f89989a70605a8225be0ffa6d Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 6 Nov 2019 17:53:12 +0000 Subject: [PATCH] libstdc++: remove redundant equality operators Now that operator<=> is supported, these operators can be generated by the compiler. * include/bits/iterator_concepts.h (unreachable_sentinel_t): Remove redundant equality operators. * testsuite/util/testsuite_iterators.h (test_range::sentinel): Likewise. From-SVN: r277888 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/bits/iterator_concepts.h | 17 ----------------- .../testsuite/util/testsuite_iterators.h | 9 --------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4f05f774b8b..5dece5c9eb5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2019-11-06 Jonathan Wakely + + * include/bits/iterator_concepts.h (unreachable_sentinel_t): Remove + redundant equality operators. + * testsuite/util/testsuite_iterators.h (test_range::sentinel): + Likewise. + 2019-11-05 Jonathan Wakely * libsupc++/compare: New header. diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index e30645e05cf..8b398616a56 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -797,23 +797,6 @@ namespace ranges friend constexpr bool operator==(unreachable_sentinel_t, const _It&) noexcept { return false; } - -#ifndef __cpp_lib_three_way_comparison - template - friend constexpr bool - operator!=(unreachable_sentinel_t, const _It&) noexcept - { return true; } - - template - friend constexpr bool - operator==(const _It&, unreachable_sentinel_t) noexcept - { return false; } - - template - friend constexpr bool - operator!=(const _It&, unreachable_sentinel_t) noexcept - { return true; } -#endif }; inline constexpr unreachable_sentinel_t unreachable_sentinel{}; diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h index d20257c1b31..4c5e9a3cc1d 100644 --- a/libstdc++-v3/testsuite/util/testsuite_iterators.h +++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h @@ -677,15 +677,6 @@ namespace __gnu_test friend bool operator==(const sentinel& s, const I& i) { return s.end == i.ptr; } - - friend bool operator!=(const sentinel& s, const I& i) - { return !(s == i); } - - friend bool operator==(const I& i, const sentinel& s) - { return s == i; } - - friend bool operator!=(const I& i, const sentinel& s) - { return !(s == i); } }; auto -- 2.30.2