Skip to content

Commit 6d48213

Browse files
committed
Updated tests
1 parent 12fc430 commit 6d48213

File tree

4 files changed

+4
-67
lines changed

4 files changed

+4
-67
lines changed

libcxx/docs/Status/Cxx2cPapers.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"`P2248R8 <https://wg21.link/P2248R8>`__","Enabling list-initialization for algorithms","2024-03 (Tokyo)","","",""
6060
"`P2810R4 <https://wg21.link/P2810R4>`__","``is_debugger_present`` ``is_replaceable``","2024-03 (Tokyo)","","",""
6161
"`P1068R11 <https://wg21.link/P1068R11>`__","Vector API for random number generation","2024-03 (Tokyo)","","",""
62-
"`P2944R3 <https://wg21.link/P2944R3>`__","Comparisons for ``reference_wrapper``","2024-03 (Tokyo)","|Partial|","19","Implemented comparisons for ``reference_wrapper`` only"
62+
"`P2944R3 <https://wg21.link/P2944R3>`__","Comparisons for ``reference_wrapper``","2024-03 (Tokyo)","|Partial|","21","Implemented changes to ``reference_wrapper``, ``pair`"
6363
"`P2642R6 <https://wg21.link/P2642R6>`__","Padded ``mdspan`` layouts","2024-03 (Tokyo)","","",""
6464
"`P3029R1 <https://wg21.link/P3029R1>`__","Better ``mdspan``'s CTAD","2024-03 (Tokyo)","|Complete|","19",""
6565
"","","","","",""

libcxx/include/tuple

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ template <class... Types>
216216
# include <__compare/common_comparison_category.h>
217217
# include <__compare/ordering.h>
218218
# include <__compare/synth_three_way.h>
219-
# include <__concepts/boolean_testable.h>
220219
# include <__config>
221220
# include <__cstddef/size_t.h>
222221
# include <__fwd/array.h>
@@ -1161,16 +1160,8 @@ struct __tuple_equal<0> {
11611160

11621161
template <class... _Tp, class... _Up>
11631162
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 bool
1164-
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
1165-
# if _LIBCPP_STD_VER >= 26
1166-
requires requires {
1167-
{ sizeof...(_Tp) == sizeof...(_Up) } -> __boolean_testable;
1168-
}
1169-
# endif
1170-
{
1171-
# if _LIBCPP_STD_VER < 26
1163+
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) {
11721164
static_assert(sizeof...(_Tp) == sizeof...(_Up), "Can't compare tuples of different sizes");
1173-
# endif
11741165
return __tuple_equal<sizeof...(_Tp)>()(__x, __y);
11751166
}
11761167

libcxx/test/std/utilities/tuple/tuple.tuple/tuple.rel/size_incompatible_comparison.verify.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@
2121

2222
#include <tuple>
2323

24-
#include "test_macros.h"
25-
2624
void f(std::tuple<int> t1, std::tuple<int, long> t2) {
2725
// We test only the core comparison operators and trust that the others
2826
// fall back on the same implementations prior to C++20.
29-
#if TEST_STD_VER >= 26
30-
static_cast<void>(t1 == t2);
31-
#else
3227
static_cast<void>(t1 == t2); // expected-error@*:* {{}}
33-
#endif
3428
static_cast<void>(t1 < t2); // expected-error@*:* {{}}
3529
}

libcxx/test/std/utilities/utility/pairs/pairs.spec/comparison.pass.cpp

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,7 @@
2525

2626
#if TEST_STD_VER >= 26
2727

28-
// template <typename T>
29-
// class EqualityComparable {
30-
// public:
31-
// constexpr EqualityComparable(T value) : value_{value} {};
32-
33-
// friend constexpr bool operator==(const EqualityComparable&, const EqualityComparable&) noexcept = default;
34-
35-
// private:
36-
// T value_;
37-
// };
38-
39-
// static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>>);
40-
// // static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>, std::pair<int,int>>);
41-
// // static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>, EqualityComparable<std::pair<int,int>>>);
42-
// // static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>, std::pair<int,int>, std::pair<int,int>>);
43-
// // static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>, EqualityComparable<std::pair<int,int>>, std::pair<int,int>>);
44-
// // static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>, std::pair<int,int>, EqualityComparable<std::pair<int,int>>>);
45-
// // static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>, EqualityComparable<std::pair<int,int>>, EqualityComparable<std::pair<int,int>>>);
46-
// static_assert(std::equality_comparable<EqualityComparable<std::pair<int,int>>, std::pair<int,int>, std::pair<int,int>, EqualityComparable<std::pair<int,int>>>);
47-
// static_assert(EqualityComparable<std::pair<int,int>>{std::pair{94, 82}} == EqualityComparable<std::pair<int,int>>{std::pair{94, 82}});
48-
// static_assert(EqualityComparable<std::pair<int,int>>{std::pair{94, 82}} != EqualityComparable<std::pair<int,int>>{std::pair{82, 82}});
28+
// Test SFINAE.
4929

5030
struct EqualityComparable {
5131
constexpr EqualityComparable(int value) : value_{value} {};
@@ -60,43 +40,15 @@ static_assert(EqualityComparable{94} == EqualityComparable{94});
6040
static_assert(EqualityComparable{94} != EqualityComparable{82});
6141

6242
static_assert(std::equality_comparable<std::pair<EqualityComparable, EqualityComparable>>);
63-
static_assert(std::pair{EqualityComparable{94}, EqualityComparable{94}} ==
64-
std::pair{EqualityComparable{94}, EqualityComparable{94}});
65-
static_assert(std::pair{EqualityComparable{82}, EqualityComparable{94}} !=
66-
std::pair{EqualityComparable{94}, EqualityComparable{94}});
67-
static_assert(std::pair{EqualityComparable{94}, EqualityComparable{82}} !=
68-
std::pair{EqualityComparable{94}, EqualityComparable{94}});
6943

7044
struct NonComparable {};
7145

72-
static_assert(!std::three_way_comparable<std::pair<NonComparable, NonComparable>>);
73-
static_assert(!std::three_way_comparable<std::pair<EqualityComparable, NonComparable>>);
74-
static_assert(!std::three_way_comparable<std::pair<NonComparable, EqualityComparable>>);
46+
static_assert(!std::equality_comparable<NonComparable>);
7547

7648
static_assert(!std::equality_comparable<std::pair<EqualityComparable, NonComparable>>);
7749
static_assert(!std::equality_comparable<std::pair<NonComparable, EqualityComparable>>);
7850

7951

80-
template <typename T, typename U>
81-
concept HasCompare = requires(T t, U u) {
82-
{ t == u } -> std::same_as<bool>;
83-
{ t != u } -> std::same_as<bool>;
84-
{ t < u } -> std::same_as<bool>;
85-
{ t > u } -> std::same_as<bool>;
86-
{ t <= u } -> std::same_as<bool>;
87-
{ t >= u } -> std::same_as<bool>;
88-
};
89-
90-
template <typename T, typename U>
91-
concept HasCompare = requires(std::pair p1, std::pair p2) {
92-
{ t == u } -> std::same_as<bool>;
93-
{ t != u } -> std::same_as<bool>;
94-
{ t < u } -> std::same_as<bool>;
95-
{ t > u } -> std::same_as<bool>;
96-
{ t <= u } -> std::same_as<bool>;
97-
{ t >= u } -> std::same_as<bool>;
98-
};
99-
10052
#endif // TEST_STD_VER >= 26
10153

10254
int main(int, char**)

0 commit comments

Comments
 (0)