[libcxx-commits] [libcxx] d4853e6 - [libc++] [ranges] Permit std::mergeable and std::sortable with HAS_NO_INCOMPLETE_RANGES.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 28 11:56:51 PST 2022


Author: Arthur O'Dwyer
Date: 2022-02-28T14:56:01-05:00
New Revision: d4853e638b8ec79d03e218e0d0f764500c30d015

URL: https://github.com/llvm/llvm-project/commit/d4853e638b8ec79d03e218e0d0f764500c30d015
DIFF: https://github.com/llvm/llvm-project/commit/d4853e638b8ec79d03e218e0d0f764500c30d015.diff

LOG: [libc++] [ranges] Permit std::mergeable and std::sortable with HAS_NO_INCOMPLETE_RANGES.

This follows the general direction of D118736 that
`_LIBCPP_HAS_NO_INCOMPLETE_RANGES` does *not* guard anything outside
of the `std::ranges::` namespace itself. This means we must permit
`ranges::less` etc. in no-ranges mode; that seems fine to me.

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

Added: 
    

Modified: 
    libcxx/include/__functional/ranges_operations.h
    libcxx/include/__iterator/mergeable.h
    libcxx/include/__iterator/sortable.h
    libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.compile.pass.cpp
    libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.subsumption.compile.pass.cpp
    libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.compile.pass.cpp
    libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.subsumption.compile.pass.cpp
    libcxx/test/std/utilities/function.objects/range.cmp/equal_to.pass.cpp
    libcxx/test/std/utilities/function.objects/range.cmp/greater.pass.cpp
    libcxx/test/std/utilities/function.objects/range.cmp/greater_equal.pass.cpp
    libcxx/test/std/utilities/function.objects/range.cmp/less.pass.cpp
    libcxx/test/std/utilities/function.objects/range.cmp/less_equal.pass.cpp
    libcxx/test/std/utilities/function.objects/range.cmp/not_equal_to.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__functional/ranges_operations.h b/libcxx/include/__functional/ranges_operations.h
index 2578c552e1d98..e7afe67ad0b63 100644
--- a/libcxx/include/__functional/ranges_operations.h
+++ b/libcxx/include/__functional/ranges_operations.h
@@ -21,7 +21,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 namespace ranges {
 
@@ -92,7 +92,8 @@ struct greater_equal {
 };
 
 } // namespace ranges
-#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+
+#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/__iterator/mergeable.h b/libcxx/include/__iterator/mergeable.h
index 4c2d1047d1299..f8d1cf6ebb7e0 100644
--- a/libcxx/include/__iterator/mergeable.h
+++ b/libcxx/include/__iterator/mergeable.h
@@ -23,7 +23,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 template <class _Input1, class _Input2, class _Output,
           class _Comp = ranges::less, class _Proj1 = identity, class _Proj2 = identity>
@@ -35,7 +35,7 @@ concept mergeable =
     indirectly_copyable<_Input2, _Output> &&
     indirect_strict_weak_order<_Comp, projected<_Input1, _Proj1>, projected<_Input2, _Proj2>>;
 
-#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/include/__iterator/sortable.h b/libcxx/include/__iterator/sortable.h
index 94337b4540d36..3d108911f416c 100644
--- a/libcxx/include/__iterator/sortable.h
+++ b/libcxx/include/__iterator/sortable.h
@@ -24,14 +24,14 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 template <class _Iter, class _Comp = ranges::less, class _Proj = identity>
 concept sortable =
   permutable<_Iter> &&
   indirect_strict_weak_order<_Comp, projected<_Iter, _Proj>>;
 
-#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 _LIBCPP_END_NAMESPACE_STD
 

diff  --git a/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.compile.pass.cpp
index 21dc0c204cec3..7caf05de0aa56 100644
--- a/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.compile.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // template<class I1, class I2, class Out,
 //     class R = ranges::less, class P1 = identity, class P2 = identity>

diff  --git a/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.subsumption.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.subsumption.compile.pass.cpp
index a17a523e6aeab..2206690519559 100644
--- a/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.subsumption.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/alg.req.mergeable/mergeable.subsumption.compile.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // template<class I1, class I2, class Out,
 //     class R = ranges::less, class P1 = identity, class P2 = identity>

diff  --git a/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.compile.pass.cpp
index 44f6ef8444dd7..07de56ce9aa94 100644
--- a/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.compile.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // template<class I, class R = ranges::less, class P = identity>
 //   concept sortable = see below;                            // since C++20

diff  --git a/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.subsumption.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.subsumption.compile.pass.cpp
index 135499d60a508..8b123379269cf 100644
--- a/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.subsumption.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.subsumption.compile.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // template<class I, class R = ranges::less, class P = identity>
 //   concept sortable = see below;                            // since C++20

diff  --git a/libcxx/test/std/utilities/function.objects/range.cmp/equal_to.pass.cpp b/libcxx/test/std/utilities/function.objects/range.cmp/equal_to.pass.cpp
index 43cfbd9760277..c27159407bb5f 100644
--- a/libcxx/test/std/utilities/function.objects/range.cmp/equal_to.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/range.cmp/equal_to.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/range.cmp/greater.pass.cpp b/libcxx/test/std/utilities/function.objects/range.cmp/greater.pass.cpp
index 31aa4274e5a70..95f490d951023 100644
--- a/libcxx/test/std/utilities/function.objects/range.cmp/greater.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/range.cmp/greater.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/range.cmp/greater_equal.pass.cpp b/libcxx/test/std/utilities/function.objects/range.cmp/greater_equal.pass.cpp
index 547c8f37e717b..a3e8ff215bb75 100644
--- a/libcxx/test/std/utilities/function.objects/range.cmp/greater_equal.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/range.cmp/greater_equal.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/range.cmp/less.pass.cpp b/libcxx/test/std/utilities/function.objects/range.cmp/less.pass.cpp
index 7415ed1202a0e..72f54b7b923fb 100644
--- a/libcxx/test/std/utilities/function.objects/range.cmp/less.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/range.cmp/less.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/range.cmp/less_equal.pass.cpp b/libcxx/test/std/utilities/function.objects/range.cmp/less_equal.pass.cpp
index aa066191e83bf..05cc56e89d403 100644
--- a/libcxx/test/std/utilities/function.objects/range.cmp/less_equal.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/range.cmp/less_equal.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // <functional>
 

diff  --git a/libcxx/test/std/utilities/function.objects/range.cmp/not_equal_to.pass.cpp b/libcxx/test/std/utilities/function.objects/range.cmp/not_equal_to.pass.cpp
index 3e91524902a68..142aaf1f74286 100644
--- a/libcxx/test/std/utilities/function.objects/range.cmp/not_equal_to.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/range.cmp/not_equal_to.pass.cpp
@@ -8,7 +8,6 @@
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 // UNSUPPORTED: libcpp-no-concepts
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // <functional>
 


        


More information about the libcxx-commits mailing list