+2020-02-09 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/range_cmp.h (__detail::__eq_builtin_ptr_cmp): Require
+ equality comparison to be valid and return bool.
+ (__detail::__less_builtin_ptr_cmp): Likewise for less-than comparison.
+ * testsuite/20_util/function_objects/range.cmp/equal_to.cc: Check
+ type with ambiguous conversion to fundamental types.
+ * testsuite/20_util/function_objects/range.cmp/less.cc: Likewise.
+
2020-02-07 Jonathan Wakely <jwakely@redhat.com>
* include/bits/iterator_concepts.h (iter_difference_t, iter_value_t):
// BUILTIN-PTR-CMP(T, ==, U)
template<typename _Tp, typename _Up>
concept __eq_builtin_ptr_cmp
- = convertible_to<_Tp, const volatile void*>
+ = requires (_Tp&& __t, _Up&& __u) { { __t == __u } -> same_as<bool>; }
+ && convertible_to<_Tp, const volatile void*>
&& convertible_to<_Up, const volatile void*>
&& (! requires(_Tp&& __t, _Up&& __u)
{ operator==(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
// BUILTIN-PTR-CMP(T, <, U)
template<typename _Tp, typename _Up>
concept __less_builtin_ptr_cmp
- = convertible_to<_Tp, const volatile void*>
+ = requires (_Tp&& __t, _Up&& __u) { { __t < __u } -> same_as<bool>; }
+ && convertible_to<_Tp, const volatile void*>
&& convertible_to<_Up, const volatile void*>
&& (! requires(_Tp&& __t, _Up&& __u)
{ operator<(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }