[libc++] Always enable the ranges concepts
authorNikolas Klauser <nikolasklauser@berlin.de>
Thu, 12 May 2022 13:46:18 +0000 (15:46 +0200)
committerNikolas Klauser <nikolasklauser@berlin.de>
Mon, 23 May 2022 18:44:34 +0000 (20:44 +0200)
The ranges concepts were already available in libc++13, so we shouldn't guard them with `_LIBCPP_HAS_NO_INCOMPLETE_RANGES`.
Fixes https://github.com/llvm/llvm-project/issues/54765

Reviewed By: #libc, ldionne

Spies: ldionne, libcxx-commits

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

libcxx/include/__ranges/concepts.h
libcxx/include/__ranges/data.h
libcxx/include/__ranges/size.h
libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp
libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/concept_conformance.compile.pass.cpp
libcxx/test/std/ranges/range.access/data.pass.cpp
libcxx/test/std/ranges/range.access/size.pass.cpp
libcxx/test/std/ranges/range.req/range.refinements/common_range.compile.pass.cpp
libcxx/test/std/ranges/range.req/range.refinements/subsumption.compile.pass.cpp

index 241f90c..87df1d1 100644 (file)
@@ -68,8 +68,6 @@ namespace ranges {
   template <range _Rp>
   using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<_Rp>>;
 
-#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
-
   // [range.sized]
   template <class _Tp>
   concept sized_range = range<_Tp> && requires(_Tp& __t) { ranges::size(__t); };
@@ -135,8 +133,6 @@ namespace ranges {
       (is_lvalue_reference_v<_Tp> ||
        (movable<remove_reference_t<_Tp>> && !__is_std_initializer_list<remove_cvref_t<_Tp>>))));
 
-#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
-
 } // namespace ranges
 
 #endif // _LIBCPP_STD_VER > 17
index 2f24d89..35d1af1 100644 (file)
@@ -24,7 +24,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCPP_STD_VER > 17
 
 // [range.prim.data]
 
@@ -99,7 +99,7 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCPP_STD_VER > 17
 
 _LIBCPP_END_NAMESPACE_STD
 
index 514c554..b832668 100644 (file)
@@ -24,7 +24,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if _LIBCPP_STD_VER > 17
 
 namespace ranges {
   template<class>
@@ -128,7 +128,7 @@ inline namespace __cpo {
 } // namespace __cpo
 } // namespace ranges
 
-#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#endif // _LIBCPP_STD_VER > 17
 
 _LIBCPP_END_NAMESPACE_STD
 
index 0d15107..3dd6b20 100644 (file)
@@ -25,7 +25,6 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 namespace ranges {
-  int output_range;
   int data;
   int size;
   int prev;
@@ -37,5 +36,5 @@ namespace ranges {
   int filter_view;
   int join_view;
   int views; // this entire namespace should be absent
-}
+} // namespace ranges
 _LIBCPP_END_NAMESPACE_STD
index be9c9ee..357e52a 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // std::ranges::data
 
index 42706d9..0568173 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // std::ranges::size
 
index 0d29c83..a546cfb 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // template<class R>
 // concept common_range;
index 244492c..23d447f 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // template<class T>
 // concept input_iterator;