[libcxx-commits] [libcxx] b177a90 - [libc++] Always enable the ranges concepts

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 23 11:45:20 PDT 2022


Author: Nikolas Klauser
Date: 2022-05-23T20:44:34+02:00
New Revision: b177a90ce7b590dfce6479142f46fd1b9554a3b3

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

LOG: [libc++] Always enable the ranges concepts

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

Added: 
    

Modified: 
    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

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__ranges/concepts.h b/libcxx/include/__ranges/concepts.h
index 241f90c0a1d17..87df1d18baf8a 100644
--- a/libcxx/include/__ranges/concepts.h
+++ b/libcxx/include/__ranges/concepts.h
@@ -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

diff  --git a/libcxx/include/__ranges/data.h b/libcxx/include/__ranges/data.h
index 2f24d89b9c457..35d1af1e648ff 100644
--- a/libcxx/include/__ranges/data.h
+++ b/libcxx/include/__ranges/data.h
@@ -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
 

diff  --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h
index 514c554ef4f0b..b832668313968 100644
--- a/libcxx/include/__ranges/size.h
+++ b/libcxx/include/__ranges/size.h
@@ -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
 

diff  --git a/libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp b/libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp
index 0d151073ca481..3dd6b20cc3733 100644
--- a/libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp
+++ b/libcxx/test/libcxx/ranges/has-no-incomplete-ranges.compile.pass.cpp
@@ -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

diff  --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/concept_conformance.compile.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/concept_conformance.compile.pass.cpp
index ce584244b34e4..88e0f77ea39fa 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.sentinel/concept_conformance.compile.pass.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-no-incomplete-ranges
 
 // <iterator>
 

diff  --git a/libcxx/test/std/ranges/range.access/data.pass.cpp b/libcxx/test/std/ranges/range.access/data.pass.cpp
index be9c9eec86b7f..357e52a146275 100644
--- a/libcxx/test/std/ranges/range.access/data.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/data.pass.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // std::ranges::data
 

diff  --git a/libcxx/test/std/ranges/range.access/size.pass.cpp b/libcxx/test/std/ranges/range.access/size.pass.cpp
index 42706d9d006fe..05681733f37d9 100644
--- a/libcxx/test/std/ranges/range.access/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/size.pass.cpp
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
 // std::ranges::size
 

diff  --git a/libcxx/test/std/ranges/range.req/range.refinements/common_range.compile.pass.cpp b/libcxx/test/std/ranges/range.req/range.refinements/common_range.compile.pass.cpp
index 0d29c834339b6..a546cfb6ccd7c 100644
--- a/libcxx/test/std/ranges/range.req/range.refinements/common_range.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.req/range.refinements/common_range.compile.pass.cpp
@@ -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;

diff  --git a/libcxx/test/std/ranges/range.req/range.refinements/subsumption.compile.pass.cpp b/libcxx/test/std/ranges/range.req/range.refinements/subsumption.compile.pass.cpp
index 244492c65500f..23d447fb34b62 100644
--- a/libcxx/test/std/ranges/range.req/range.refinements/subsumption.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.req/range.refinements/subsumption.compile.pass.cpp
@@ -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;


        


More information about the libcxx-commits mailing list