diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ae5fedbc66b..a9cd2599243 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2020-03-18 Jonathan Wakely + * include/std/stop_token (stop_token::_Stop_state_ref): Define + comparison operators explicitly if the compiler won't synthesize them. + * include/bits/stl_algobase.h (__lexicographical_compare_aux): Check __cpp_lib_concepts before using iter_reference_t. * include/bits/stream_iterator.h (istream_iterator): Check diff --git a/libstdc++-v3/include/std/stop_token b/libstdc++-v3/include/std/stop_token index 6fb8ae05197..87beb08c71d 100644 --- a/libstdc++-v3/include/std/stop_token +++ b/libstdc++-v3/include/std/stop_token @@ -456,8 +456,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Stop_state_t* operator->() const noexcept { return _M_ptr; } +#if __cpp_impl_three_way_comparison >= 201907L friend bool operator==(const _Stop_state_ref&, const _Stop_state_ref&) = default; +#else + friend bool + operator==(const _Stop_state_ref& __lhs, const _Stop_state_ref& __rhs) + noexcept + { return __lhs._M_ptr == __rhs._M_ptr; } + + friend bool + operator!=(const _Stop_state_ref& __lhs, const _Stop_state_ref& __rhs) + noexcept + { return __lhs._M_ptr != __rhs._M_ptr; } +#endif private: _Stop_state_t* _M_ptr = nullptr;