diff options
author | Louis Dionne <ldionne.2@gmail.com> | 2024-08-01 15:56:06 -0400 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2024-08-01 15:56:06 -0400 |
commit | 451bba6fbf0bc9a2bfff9253ac45caf7c57d38b9 (patch) | |
tree | dc740839b804783b8aa0f7626f1dc885584604d5 /libcxx/test/std/algorithms | |
parent | 0def9a923dadc2b2b3dd067eefcef541e475594c (diff) | |
download | llvm-451bba6fbf0bc9a2bfff9253ac45caf7c57d38b9.zip llvm-451bba6fbf0bc9a2bfff9253ac45caf7c57d38b9.tar.gz llvm-451bba6fbf0bc9a2bfff9253ac45caf7c57d38b9.tar.bz2 |
[libc++] Revert "Check correctly ref-qualified __is_callable in algorithms (#73451)"
This reverts commit 8d151f804ff43aaed1edf810bb2a07607b8bba14, which
broke some build bots. I think that is caused by an invalid argument
order when checking __is_comparable in upper_bound.
Diffstat (limited to 'libcxx/test/std/algorithms')
5 files changed, 26 insertions, 30 deletions
diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp index 4e4f889..ea4270e 100644 --- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp +++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp @@ -51,7 +51,7 @@ struct S { }; struct eq { - bool operator()(const S& a, const S& b) const { return a.i_ == b.i_; } + bool operator()(const S& a, const S&b) { return a.i_ == b.i_; } }; diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp index 2fa3e9f..3bf72e3 100644 --- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp +++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_n_pred.pass.cpp @@ -32,13 +32,12 @@ TEST_CONSTEXPR bool test_constexpr() { } #endif -struct count_equal { - static unsigned count; - template <class T> - bool operator()(const T& x, const T& y) const { - ++count; - return x == y; - } +struct count_equal +{ + static unsigned count; + template <class T> + bool operator()(const T& x, const T& y) + {++count; return x == y;} }; unsigned count_equal::count = 0; diff --git a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp index cfb82f3..f835d2f 100644 --- a/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp +++ b/libcxx/test/std/algorithms/alg.nonmodifying/alg.search/search_pred.pass.cpp @@ -36,15 +36,8 @@ struct count_equal { static unsigned count; template <class T> - bool operator()(const T& x, const T& y) & { - ++count; - return x == y; - }; - template <class T> - bool operator()(const T& x, const T& y) const& { - ++count; - return x == y; - }; + bool operator()(const T& x, const T& y) + {++count; return x == y;} }; unsigned count_equal::count = 0; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp index ebff401..d103e8c 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp @@ -24,11 +24,11 @@ #if TEST_STD_VER >= 11 #include <memory> -struct indirect_less { - template <class P> - bool operator()(const P& x, const P& y) const { - return *x < *y; - } +struct indirect_less +{ + template <class P> + bool operator()(const P& x, const P& y) + {return *x < *y;} }; struct S { @@ -119,7 +119,7 @@ test() struct less_by_first { template <typename Pair> - bool operator()(const Pair& lhs, const Pair& rhs) const { + bool operator()(const Pair& lhs, const Pair& rhs) { return std::less<typename Pair::first_type>()(lhs.first, rhs.first); } }; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp index 5ee6d89..46c2a42 100644 --- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp @@ -25,17 +25,21 @@ #include "test_macros.h" -struct indirect_less { - template <class P> - bool operator()(const P& x, const P& y) const { - return *x < *y; - } +struct indirect_less +{ + template <class P> + bool operator()(const P& x, const P& y) + {return *x < *y;} }; std::mt19937 randomness; -struct first_only { - bool operator()(const std::pair<int, int>& x, const std::pair<int, int>& y) const { return x.first < y.first; } +struct first_only +{ + bool operator()(const std::pair<int, int>& x, const std::pair<int, int>& y) + { + return x.first < y.first; + } }; void test() |