[libcxx-commits] [libcxx] [libcxx] removes non-customisation-point objects from `__cpo` namespace (PR #76542)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 28 14:54:13 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Christopher Di Bella (cjdb)

<details>
<summary>Changes</summary>

Customisation-point objects often rely on ADL as a hook for users to customise their behaviour. This requires a function declaration with the same name as the CPO (which is a function object) in the same scope as the CPO. The technique for getting around having both a function and a function object in the same scope is to put the CPO inside an inline namespace: the function is declared as deleted, and so only the CPO can be called.

The iterator primitive functions and algorithms in `std::ranges` are not CPOs and thus do not need to be in the `__cpo` namespace.

---

Patch is 46.77 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/76542.diff


94 Files Affected:

- (modified) libcxx/include/__algorithm/ranges_adjacent_find.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_all_of.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_any_of.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_binary_search.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_clamp.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_contains.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_copy_backward.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_copy_if.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_copy_n.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_count.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_count_if.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_ends_with.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_equal.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_equal_range.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_fill.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_fill_n.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_find.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_find_end.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_find_first_of.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_find_if.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_find_if_not.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_for_each.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_for_each_n.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_generate.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_generate_n.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_includes.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_inplace_merge.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_is_heap.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_is_heap_until.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_is_partitioned.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_is_permutation.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_is_sorted.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_is_sorted_until.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_lexicographical_compare.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_lower_bound.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_make_heap.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_max.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_max_element.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_merge.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_min.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_min_element.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_minmax.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_minmax_element.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_mismatch.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_move.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_move_backward.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_next_permutation.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_none_of.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_nth_element.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_partial_sort.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_partial_sort_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_partition.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_partition_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_partition_point.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_pop_heap.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_prev_permutation.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_push_heap.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_remove.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_remove_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_remove_copy_if.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_remove_if.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_replace.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_replace_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_replace_copy_if.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_replace_if.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_reverse.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_reverse_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_rotate.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_rotate_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_sample.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_search.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_search_n.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_set_difference.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_set_intersection.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_set_symmetric_difference.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_set_union.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_shuffle.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_sort.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_sort_heap.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_stable_partition.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_stable_sort.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_starts_with.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_swap_ranges.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_transform.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_unique.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_unique_copy.h (-2) 
- (modified) libcxx/include/__algorithm/ranges_upper_bound.h (-2) 
- (modified) libcxx/include/__iterator/advance.h (-2) 
- (modified) libcxx/include/__iterator/distance.h (-2) 
- (modified) libcxx/include/__iterator/next.h (-2) 
- (modified) libcxx/include/__iterator/prev.h (-2) 
- (modified) libcxx/include/__memory/ranges_construct_at.h (-8) 
- (modified) libcxx/include/__memory/ranges_uninitialized_algorithms.h (-20) 


``````````diff
diff --git a/libcxx/include/__algorithm/ranges_adjacent_find.h b/libcxx/include/__algorithm/ranges_adjacent_find.h
index a10b04167ede69..fb73227a2f969c 100644
--- a/libcxx/include/__algorithm/ranges_adjacent_find.h
+++ b/libcxx/include/__algorithm/ranges_adjacent_find.h
@@ -69,9 +69,7 @@ struct __fn {
 };
 } // namespace __adjacent_find
 
-inline namespace __cpo {
 inline constexpr auto adjacent_find = __adjacent_find::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_all_of.h b/libcxx/include/__algorithm/ranges_all_of.h
index 39a2ae4de01e99..ee733131ee572e 100644
--- a/libcxx/include/__algorithm/ranges_all_of.h
+++ b/libcxx/include/__algorithm/ranges_all_of.h
@@ -57,9 +57,7 @@ struct __fn {
 };
 } // namespace __all_of
 
-inline namespace __cpo {
 inline constexpr auto all_of = __all_of::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_any_of.h b/libcxx/include/__algorithm/ranges_any_of.h
index 2ca8531102eac6..e9786a3d336bf6 100644
--- a/libcxx/include/__algorithm/ranges_any_of.h
+++ b/libcxx/include/__algorithm/ranges_any_of.h
@@ -57,9 +57,7 @@ struct __fn {
 };
 } // namespace __any_of
 
-inline namespace __cpo {
 inline constexpr auto any_of = __any_of::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_binary_search.h b/libcxx/include/__algorithm/ranges_binary_search.h
index 22008e0f1bc8f6..cbf487e78c74bb 100644
--- a/libcxx/include/__algorithm/ranges_binary_search.h
+++ b/libcxx/include/__algorithm/ranges_binary_search.h
@@ -56,9 +56,7 @@ struct __fn {
 };
 } // namespace __binary_search
 
-inline namespace __cpo {
 inline constexpr auto binary_search = __binary_search::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_clamp.h b/libcxx/include/__algorithm/ranges_clamp.h
index e6c86207254a19..a24043f2ee1c83 100644
--- a/libcxx/include/__algorithm/ranges_clamp.h
+++ b/libcxx/include/__algorithm/ranges_clamp.h
@@ -48,9 +48,7 @@ struct __fn {
 };
 } // namespace __clamp
 
-inline namespace __cpo {
 inline constexpr auto clamp = __clamp::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_contains.h b/libcxx/include/__algorithm/ranges_contains.h
index f92fcec587d858..95b4e463191adb 100644
--- a/libcxx/include/__algorithm/ranges_contains.h
+++ b/libcxx/include/__algorithm/ranges_contains.h
@@ -49,9 +49,7 @@ struct __fn {
 };
 } // namespace __contains
 
-inline namespace __cpo {
 inline constexpr auto contains = __contains::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_copy.h b/libcxx/include/__algorithm/ranges_copy.h
index 1c87f074e7cab9..f16db0ed557e9c 100644
--- a/libcxx/include/__algorithm/ranges_copy.h
+++ b/libcxx/include/__algorithm/ranges_copy.h
@@ -54,9 +54,7 @@ struct __fn {
 };
 } // namespace __copy
 
-inline namespace __cpo {
 inline constexpr auto copy = __copy::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_copy_backward.h b/libcxx/include/__algorithm/ranges_copy_backward.h
index 865e944d4384dd..023bc69862d2fb 100644
--- a/libcxx/include/__algorithm/ranges_copy_backward.h
+++ b/libcxx/include/__algorithm/ranges_copy_backward.h
@@ -52,9 +52,7 @@ struct __fn {
 };
 } // namespace __copy_backward
 
-inline namespace __cpo {
 inline constexpr auto copy_backward = __copy_backward::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_copy_if.h b/libcxx/include/__algorithm/ranges_copy_if.h
index b77dbd37fcee3a..3b07b2083ce45f 100644
--- a/libcxx/include/__algorithm/ranges_copy_if.h
+++ b/libcxx/include/__algorithm/ranges_copy_if.h
@@ -70,9 +70,7 @@ struct __fn {
 };
 } // namespace __copy_if
 
-inline namespace __cpo {
 inline constexpr auto copy_if = __copy_if::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_copy_n.h b/libcxx/include/__algorithm/ranges_copy_n.h
index 99e8eee14d0f83..48c2c227c22ec2 100644
--- a/libcxx/include/__algorithm/ranges_copy_n.h
+++ b/libcxx/include/__algorithm/ranges_copy_n.h
@@ -64,9 +64,7 @@ struct __fn {
 };
 } // namespace __copy_n
 
-inline namespace __cpo {
 inline constexpr auto copy_n = __copy_n::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 #endif // _LIBCPP_STD_VER >= 20
diff --git a/libcxx/include/__algorithm/ranges_count.h b/libcxx/include/__algorithm/ranges_count.h
index 4c8f1b2cbea7e4..294726e6e3508d 100644
--- a/libcxx/include/__algorithm/ranges_count.h
+++ b/libcxx/include/__algorithm/ranges_count.h
@@ -49,9 +49,7 @@ struct __fn {
 };
 } // namespace __count
 
-inline namespace __cpo {
 inline constexpr auto count = __count::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_count_if.h b/libcxx/include/__algorithm/ranges_count_if.h
index 92f37d049e0c4d..728b7886441de7 100644
--- a/libcxx/include/__algorithm/ranges_count_if.h
+++ b/libcxx/include/__algorithm/ranges_count_if.h
@@ -62,9 +62,7 @@ struct __fn {
 };
 } // namespace __count_if
 
-inline namespace __cpo {
 inline constexpr auto count_if = __count_if::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_ends_with.h b/libcxx/include/__algorithm/ranges_ends_with.h
index 2afb74bff0f152..e2e614615d4cc5 100644
--- a/libcxx/include/__algorithm/ranges_ends_with.h
+++ b/libcxx/include/__algorithm/ranges_ends_with.h
@@ -184,9 +184,7 @@ struct __fn {
 };
 } // namespace __ends_with
 
-inline namespace __cpo {
 inline constexpr auto ends_with = __ends_with::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_equal.h b/libcxx/include/__algorithm/ranges_equal.h
index 4cb1f7df1952e5..354fbd88e77d53 100644
--- a/libcxx/include/__algorithm/ranges_equal.h
+++ b/libcxx/include/__algorithm/ranges_equal.h
@@ -92,9 +92,7 @@ struct __fn {
 };
 } // namespace __equal
 
-inline namespace __cpo {
 inline constexpr auto equal = __equal::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_equal_range.h b/libcxx/include/__algorithm/ranges_equal_range.h
index 1ff8856ca03f1e..9ae6e8ce7642c6 100644
--- a/libcxx/include/__algorithm/ranges_equal_range.h
+++ b/libcxx/include/__algorithm/ranges_equal_range.h
@@ -63,9 +63,7 @@ struct __fn {
 
 } // namespace __equal_range
 
-inline namespace __cpo {
 inline constexpr auto equal_range = __equal_range::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_fill.h b/libcxx/include/__algorithm/ranges_fill.h
index 88a892f5c27865..8b4d393e9e69cc 100644
--- a/libcxx/include/__algorithm/ranges_fill.h
+++ b/libcxx/include/__algorithm/ranges_fill.h
@@ -45,9 +45,7 @@ struct __fn {
 };
 } // namespace __fill
 
-inline namespace __cpo {
 inline constexpr auto fill = __fill::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_fill_n.h b/libcxx/include/__algorithm/ranges_fill_n.h
index dbd8ec27aef9f5..6385ebc0601d40 100644
--- a/libcxx/include/__algorithm/ranges_fill_n.h
+++ b/libcxx/include/__algorithm/ranges_fill_n.h
@@ -36,9 +36,7 @@ struct __fn {
 };
 } // namespace __fill_n
 
-inline namespace __cpo {
 inline constexpr auto fill_n = __fill_n::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_find.h b/libcxx/include/__algorithm/ranges_find.h
index de870e381184c6..a1511705a6b963 100644
--- a/libcxx/include/__algorithm/ranges_find.h
+++ b/libcxx/include/__algorithm/ranges_find.h
@@ -63,9 +63,7 @@ struct __fn {
 };
 } // namespace __find
 
-inline namespace __cpo {
 inline constexpr auto find = __find::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_find_end.h b/libcxx/include/__algorithm/ranges_find_end.h
index 2c57ad424bfdea..86941e15d89e1d 100644
--- a/libcxx/include/__algorithm/ranges_find_end.h
+++ b/libcxx/include/__algorithm/ranges_find_end.h
@@ -86,9 +86,7 @@ struct __fn {
 };
 } // namespace __find_end
 
-inline namespace __cpo {
 inline constexpr auto find_end = __find_end::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_find_first_of.h b/libcxx/include/__algorithm/ranges_find_first_of.h
index ec6d52c63250b5..a0412c60d03e6d 100644
--- a/libcxx/include/__algorithm/ranges_find_first_of.h
+++ b/libcxx/include/__algorithm/ranges_find_first_of.h
@@ -89,9 +89,7 @@ struct __fn {
 };
 } // namespace __find_first_of
 
-inline namespace __cpo {
 inline constexpr auto find_first_of = __find_first_of::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_find_if.h b/libcxx/include/__algorithm/ranges_find_if.h
index af54a5007ee259..5afe7d0368a716 100644
--- a/libcxx/include/__algorithm/ranges_find_if.h
+++ b/libcxx/include/__algorithm/ranges_find_if.h
@@ -58,9 +58,7 @@ struct __fn {
 };
 } // namespace __find_if
 
-inline namespace __cpo {
 inline constexpr auto find_if = __find_if::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_find_if_not.h b/libcxx/include/__algorithm/ranges_find_if_not.h
index a18bea43165e0d..572e929cafa5bd 100644
--- a/libcxx/include/__algorithm/ranges_find_if_not.h
+++ b/libcxx/include/__algorithm/ranges_find_if_not.h
@@ -52,9 +52,7 @@ struct __fn {
 };
 } // namespace __find_if_not
 
-inline namespace __cpo {
 inline constexpr auto find_if_not = __find_if_not::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_for_each.h b/libcxx/include/__algorithm/ranges_for_each.h
index 7878ed26709fb6..13573f887df385 100644
--- a/libcxx/include/__algorithm/ranges_for_each.h
+++ b/libcxx/include/__algorithm/ranges_for_each.h
@@ -64,9 +64,7 @@ struct __fn {
 };
 } // namespace __for_each
 
-inline namespace __cpo {
 inline constexpr auto for_each = __for_each::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_for_each_n.h b/libcxx/include/__algorithm/ranges_for_each_n.h
index 53ccb9a6035a48..eeaf41398b3bb2 100644
--- a/libcxx/include/__algorithm/ranges_for_each_n.h
+++ b/libcxx/include/__algorithm/ranges_for_each_n.h
@@ -47,9 +47,7 @@ struct __fn {
 };
 } // namespace __for_each_n
 
-inline namespace __cpo {
 inline constexpr auto for_each_n = __for_each_n::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_generate.h b/libcxx/include/__algorithm/ranges_generate.h
index 3ff1e13c422090..75343e3846fcf7 100644
--- a/libcxx/include/__algorithm/ranges_generate.h
+++ b/libcxx/include/__algorithm/ranges_generate.h
@@ -56,9 +56,7 @@ struct __fn {
 
 } // namespace __generate
 
-inline namespace __cpo {
 inline constexpr auto generate = __generate::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_generate_n.h b/libcxx/include/__algorithm/ranges_generate_n.h
index c025c621a191c2..4ab7795699a653 100644
--- a/libcxx/include/__algorithm/ranges_generate_n.h
+++ b/libcxx/include/__algorithm/ranges_generate_n.h
@@ -48,9 +48,7 @@ struct __fn {
 
 } // namespace __generate_n
 
-inline namespace __cpo {
 inline constexpr auto generate_n = __generate_n::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_includes.h b/libcxx/include/__algorithm/ranges_includes.h
index aa35080c8cfd4b..e7da9427115d22 100644
--- a/libcxx/include/__algorithm/ranges_includes.h
+++ b/libcxx/include/__algorithm/ranges_includes.h
@@ -81,9 +81,7 @@ struct __fn {
 
 } // namespace __includes
 
-inline namespace __cpo {
 inline constexpr auto includes = __includes::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_inplace_merge.h b/libcxx/include/__algorithm/ranges_inplace_merge.h
index 86001b003d5ca1..c483d322618a57 100644
--- a/libcxx/include/__algorithm/ranges_inplace_merge.h
+++ b/libcxx/include/__algorithm/ranges_inplace_merge.h
@@ -67,9 +67,7 @@ struct __fn {
 
 } // namespace __inplace_merge
 
-inline namespace __cpo {
 inline constexpr auto inplace_merge = __inplace_merge::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_is_heap.h b/libcxx/include/__algorithm/ranges_is_heap.h
index f298c347b747a0..08a70eee8e650d 100644
--- a/libcxx/include/__algorithm/ranges_is_heap.h
+++ b/libcxx/include/__algorithm/ranges_is_heap.h
@@ -64,9 +64,7 @@ struct __fn {
 
 } // namespace __is_heap
 
-inline namespace __cpo {
 inline constexpr auto is_heap = __is_heap::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_is_heap_until.h b/libcxx/include/__algorithm/ranges_is_heap_until.h
index 73f13fb50440ec..dfa9a2ba3072f2 100644
--- a/libcxx/include/__algorithm/ranges_is_heap_until.h
+++ b/libcxx/include/__algorithm/ranges_is_heap_until.h
@@ -64,9 +64,7 @@ struct __fn {
 
 } // namespace __is_heap_until
 
-inline namespace __cpo {
 inline constexpr auto is_heap_until = __is_heap_until::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_is_partitioned.h b/libcxx/include/__algorithm/ranges_is_partitioned.h
index 76db870efc7073..2ce5d4c7ea2191 100644
--- a/libcxx/include/__algorithm/ranges_is_partitioned.h
+++ b/libcxx/include/__algorithm/ranges_is_partitioned.h
@@ -69,9 +69,7 @@ struct __fn {
 };
 } // namespace __is_partitioned
 
-inline namespace __cpo {
 inline constexpr auto is_partitioned = __is_partitioned::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_is_permutation.h b/libcxx/include/__algorithm/ranges_is_permutation.h
index 2b99839bc66fa7..2959bce00e0d13 100644
--- a/libcxx/include/__algorithm/ranges_is_permutation.h
+++ b/libcxx/include/__algorithm/ranges_is_permutation.h
@@ -90,9 +90,7 @@ struct __fn {
 };
 } // namespace __is_permutation
 
-inline namespace __cpo {
 inline constexpr auto is_permutation = __is_permutation::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_is_sorted.h b/libcxx/include/__algorithm/ranges_is_sorted.h
index 3eb2c768d66a20..b6e028a15a0570 100644
--- a/libcxx/include/__algorithm/ranges_is_sorted.h
+++ b/libcxx/include/__algorithm/ranges_is_sorted.h
@@ -50,9 +50,7 @@ struct __fn {
 };
 } // namespace __is_sorted
 
-inline namespace __cpo {
 inline constexpr auto is_sorted = __is_sorted::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_is_sorted_until.h b/libcxx/include/__algorithm/ranges_is_sorted_until.h
index 19e9875d2757d4..3eeaac93e73a42 100644
--- a/libcxx/include/__algorithm/ranges_is_sorted_until.h
+++ b/libcxx/include/__algorithm/ranges_is_sorted_until.h
@@ -65,9 +65,7 @@ struct __fn {
 };
 } // namespace __is_sorted_until
 
-inline namespace __cpo {
 inline constexpr auto is_sorted_until = __is_sorted_until::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_lexicographical_compare.h b/libcxx/include/__algorithm/ranges_lexicographical_compare.h
index 5b843dfd7b3139..06a44d10aacefa 100644
--- a/libcxx/include/__algorithm/ranges_lexicographical_compare.h
+++ b/libcxx/include/__algorithm/ranges_lexicographical_compare.h
@@ -89,9 +89,7 @@ struct __fn {
 };
 } // namespace __lexicographical_compare
 
-inline namespace __cpo {
 inline constexpr auto lexicographical_compare = __lexicographical_compare::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_lower_bound.h b/libcxx/include/__algorithm/ranges_lower_bound.h
index 58b3f815b96a45..7b396fd8f31c80 100644
--- a/libcxx/include/__algorithm/ranges_lower_bound.h
+++ b/libcxx/include/__algorithm/ranges_lower_bound.h
@@ -56,9 +56,7 @@ struct __fn {
 };
 } // namespace __lower_bound
 
-inline namespace __cpo {
 inline constexpr auto lower_bound = __lower_bound::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_make_heap.h b/libcxx/include/__algorithm/ranges_make_heap.h
index f17eabff43d2a1..7f472e905e5694 100644
--- a/libcxx/include/__algorithm/ranges_make_heap.h
+++ b/libcxx/include/__algorithm/ranges_make_heap.h
@@ -68,9 +68,7 @@ struct __fn {
 
 } // namespace __make_heap
 
-inline namespace __cpo {
 inline constexpr auto make_heap = __make_heap::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_max.h b/libcxx/include/__algorithm/ranges_max.h
index 0f89cb2ff5bf22..cf15617cec263c 100644
--- a/libcxx/include/__algorithm/ranges_max.h
+++ b/libcxx/include/__algorithm/ranges_max.h
@@ -89,9 +89,7 @@ struct __fn {
 };
 } // namespace __max
 
-inline namespace __cpo {
 inline constexpr auto max = __max::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_max_element.h b/libcxx/include/__algorithm/ranges_max_element.h
index 2ba97042f1f6e0..2410c38f412d5d 100644
--- a/libcxx/include/__algorithm/ranges_max_element.h
+++ b/libcxx/include/__algorithm/ranges_max_element.h
@@ -52,9 +52,7 @@ struct __fn {
 };
 } // namespace __max_element
 
-inline namespace __cpo {
 inline constexpr auto max_element = __max_element::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_merge.h b/libcxx/include/__algorithm/ranges_merge.h
index 7f49154ec9221f..5136893a268306 100644
--- a/libcxx/include/__algorithm/ranges_merge.h
+++ b/libcxx/include/__algorithm/ranges_merge.h
@@ -121,9 +121,7 @@ struct __fn {
 
 } // namespace __merge
 
-inline namespace __cpo {
 inline constexpr auto merge = __merge::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_min.h b/libcxx/include/__algorithm/ranges_min.h
index 8757358cdf37d9..194fe62cbd5e9b 100644
--- a/libcxx/include/__algorithm/ranges_min.h
+++ b/libcxx/include/__algorithm/ranges_min.h
@@ -81,9 +81,7 @@ struct __fn {
 };
 } // namespace __min
 
-inline namespace __cpo {
 inline constexpr auto min = __min::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_min_element.h b/libcxx/include/__algorithm/ranges_min_element.h
index 07826a0e6b817a..e9ff7c2a63a718 100644
--- a/libcxx/include/__algorithm/ranges_min_element.h
+++ b/libcxx/include/__algorithm/ranges_min_element.h
@@ -64,9 +64,7 @@ struct __fn {
 };
 } // namespace __min_element
 
-inline namespace __cpo {
 inline constexpr auto min_element = __min_element::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__algorithm/ranges_minmax.h b/libcxx/include/__algorithm/ranges_minmax.h
index 22a62b620c936f..9540a236830f06 100644
--- a/libcxx/include/__algorithm/ranges_minmax.h
+++ b/libcxx/include/__algorithm/ranges_minmax.h
@@ -146,9 +146,7 @@ struct __fn {
 };
 } // namespace __minmax
 
-inline namespace __cpo {
 inline constexpr auto minmax = __minmax::__fn{};
-} // namespace __cpo
 } // namespace ranges
 
 _LIBCPP_END_NAMESPACE_STD
dif...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/76542


More information about the libcxx-commits mailing list