[libc++][ranges][NFC] Make sure all implemented algorithms are enabled in "robust" tests.

Also fix `std::find_first_of` (which accidentally copied the predicate
in the implementation).

Differential Revision: https://reviews.llvm.org/D131235

GitOrigin-RevId: 8ac015caf627a0db89540950d6343e955ba9500b
diff --git a/include/__algorithm/find_first_of.h b/include/__algorithm/find_first_of.h
index b968329..2096b0f 100644
--- a/include/__algorithm/find_first_of.h
+++ b/include/__algorithm/find_first_of.h
@@ -24,7 +24,8 @@
 _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1,
                                                                    _ForwardIterator1 __last1,
                                                                    _ForwardIterator2 __first2,
-                                                                   _ForwardIterator2 __last2, _BinaryPredicate __pred) {
+                                                                   _ForwardIterator2 __last2,
+                                                                   _BinaryPredicate&& __pred) {
   for (; __first1 != __last1; ++__first1)
     for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
       if (__pred(*__first1, *__j))
diff --git a/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp b/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp
index 419e2eb..343ef41 100644
--- a/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp
+++ b/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp
@@ -121,9 +121,9 @@
     (void)std::ranges::for_each(first, last, UnaryVoid(&copies)); assert(copies == 1); copies = 0;
     (void)std::ranges::for_each(a, UnaryVoid(&copies)); assert(copies == 1); copies = 0;
     (void)std::ranges::for_each_n(first, count, UnaryVoid(&copies)); assert(copies == 1); copies = 0;
-    //(void)std::ranges::generate(first, last, NullaryValue(&copies)); assert(copies == 0);
-    //(void)std::ranges::generate(a, NullaryValue(&copies)); assert(copies == 0);
-    //(void)std::ranges::generate_n(first, count, NullaryValue(&copies)); assert(copies == 0);
+    (void)std::ranges::generate(first, last, NullaryValue(&copies)); assert(copies == 0);
+    (void)std::ranges::generate(a, NullaryValue(&copies)); assert(copies == 0);
+    (void)std::ranges::generate_n(first, count, NullaryValue(&copies)); assert(copies == 0);
     (void)std::ranges::includes(first, last, first2, last2, Less(&copies)); assert(copies == 0);
     (void)std::ranges::includes(a, b, Less(&copies)); assert(copies == 0);
     (void)std::ranges::is_heap(first, last, Less(&copies)); assert(copies == 0);
diff --git a/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp b/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
index 66b8b36..0f50d1c 100644
--- a/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
+++ b/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
@@ -120,7 +120,7 @@
 #endif
     (void)std::equal_range(first, last, value, Less<T>(&copies)); assert(copies == 0);
     (void)std::find_end(first, last, first2, mid2, Equal<T>(&copies)); assert(copies == 0);
-    //(void)std::find_first_of(first, last, first2, last2, Equal(&copies)); assert(copies == 0);
+    (void)std::find_first_of(first, last, first2, last2, Equal<T>(&copies)); assert(copies == 0);
     (void)std::find_if(first, last, UnaryTrue<T>(&copies)); assert(copies == 0);
     (void)std::find_if_not(first, last, UnaryTrue<T>(&copies)); assert(copies == 0);
     (void)std::for_each(first, last, UnaryVoid<T>(&copies)); assert(copies == 1); copies = 0;
diff --git a/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp b/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp
index 953fc72..d50de6e 100644
--- a/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp
+++ b/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp
@@ -36,8 +36,8 @@
 static_assert(std::is_same_v<in_out_result<int, long>, remove_copy_if_result<int, long>>);
 static_assert(std::is_same_v<in_out_result<int, long>, replace_copy_result<int, long>>);
 static_assert(std::is_same_v<in_out_result<int, long>, replace_copy_if_result<int, long>>);
-// static_assert(std::is_same_v<in_out_result<int, long>, reverse_copy_result<int, long>>);
-// static_assert(std::is_same_v<in_out_result<int, long>, rotate_copy_result<int, long>>);
+static_assert(std::is_same_v<in_out_result<int, long>, reverse_copy_result<int, long>>);
+static_assert(std::is_same_v<in_out_result<int, long>, rotate_copy_result<int, long>>);
 static_assert(std::is_same_v<in_out_result<int, long>, set_difference_result<int, long>>);
 static_assert(std::is_same_v<in_out_result<int, long>, unary_transform_result<int, long>>);
 static_assert(std::is_same_v<in_out_result<int, long>, uninitialized_copy_result<int, long>>);
diff --git a/test/std/algorithms/ranges_robust_against_dangling.pass.cpp b/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
index e42892d..7da2ee5 100644
--- a/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
+++ b/test/std/algorithms/ranges_robust_against_dangling.pass.cpp
@@ -76,8 +76,10 @@
   using std::ranges::mismatch_result;
   using std::ranges::move_result;
   using std::ranges::move_backward_result;
+  using std::ranges::next_permutation_result;
   using std::ranges::partial_sort_copy_result;
   using std::ranges::partition_copy_result;
+  using std::ranges::prev_permutation_result;
   using std::ranges::remove_copy_result;
   using std::ranges::remove_copy_if_result;
   using std::ranges::replace_copy_result;
@@ -199,8 +201,8 @@
   dangling_1st(std::ranges::push_heap, in);
   dangling_1st(std::ranges::pop_heap, in);
   dangling_1st(std::ranges::sort_heap, in);
-  //dangling_1st(std::ranges::prev_permutation, in);
-  //dangling_1st(std::ranges::next_permutation, in);
+  dangling_1st<prev_permutation_result<dangling>>(std::ranges::prev_permutation, in);
+  dangling_1st<next_permutation_result<dangling>>(std::ranges::next_permutation, in);
 
   return true;
 }
diff --git a/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp b/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp
index 5517e7b..05599e2 100644
--- a/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp
+++ b/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp
@@ -69,7 +69,6 @@
   int count = 1;
 
   auto unary_pred = [](const Proxy<T&>&) { return true; };
-  //auto binary_pred = [](const Proxy<T>&, const Proxy<T>&) { return return false; };
   auto binary_func = [](const Proxy<T>&, const Proxy<T>&) -> Proxy<T> { return Proxy<T>(T()); };
   auto gen = [] { return Proxy<T>(T{42}); };
 
@@ -87,7 +86,7 @@
   test(std::ranges::partition_point, in, unary_pred);
   test(std::ranges::lower_bound, in, x);
   test(std::ranges::upper_bound, in, x);
-  //test(std::ranges::equal_range, in, x);
+  test(std::ranges::equal_range, in, x);
   test(std::ranges::binary_search, in, x);
 
   test(std::ranges::min_element, in);
@@ -169,8 +168,8 @@
   test(std::ranges::push_heap, in);
   test(std::ranges::pop_heap, in);
   test(std::ranges::sort_heap, in);
-  //test(std::ranges::prev_permutation, in);
-  //test(std::ranges::next_permutation, in);
+  test(std::ranges::prev_permutation, in);
+  test(std::ranges::next_permutation, in);
 
   // The algorithms that work on uninitialized memory have constraints that prevent proxy iterators from being used with
   // them.
diff --git a/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp b/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp
index 9e5398b..eba4351 100644
--- a/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp
+++ b/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp
@@ -56,7 +56,6 @@
 auto odd = [](int x) { return x % 2 != 0; };
 auto triple = [](int x) { return 3*x; };
 auto gen = [] { return 42; };
-//auto plus = [](int x, int y) { return x == y; };
 std::mt19937 g;
 
 // [algorithm.syn]
@@ -79,7 +78,7 @@
 static_assert(test(std::ranges::fill_n, a, 10, 42));
 static_assert(test(std::ranges::find, a, 42));
 static_assert(test(std::ranges::find_end, a, a));
-//static_assert(test(std::ranges::find_first_of, a, a));
+static_assert(test(std::ranges::find_first_of, a, a));
 static_assert(test(std::ranges::find_if, a, odd));
 static_assert(test(std::ranges::find_if_not, a, odd));
 static_assert(test(std::ranges::for_each, a, odd));
@@ -107,7 +106,7 @@
 static_assert(test(std::ranges::mismatch, a, a));
 static_assert(test(std::ranges::move, a, a));
 static_assert(test(std::ranges::move_backward, a, a));
-//static_assert(test(std::ranges::next_permutation, a));
+static_assert(test(std::ranges::next_permutation, a));
 static_assert(test(std::ranges::none_of, a, odd));
 static_assert(test(std::ranges::nth_element, a, a+5));
 static_assert(test(std::ranges::partial_sort, a, a+5));
@@ -116,7 +115,7 @@
 static_assert(test(std::ranges::partition_copy, a, a, a, odd));
 static_assert(test(std::ranges::partition_point, a, odd));
 static_assert(test(std::ranges::pop_heap, a));
-//static_assert(test(std::ranges::prev_permutation, a));
+static_assert(test(std::ranges::prev_permutation, a));
 static_assert(test(std::ranges::push_heap, a));
 static_assert(test(std::ranges::remove, a, 42));
 static_assert(test(std::ranges::remove_copy, a, a, 42));