[llvm-branch-commits] [libcxx] 55e34f3 - [libc++] Always enable the ranges concepts

Louis Dionne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue May 24 06:15:00 PDT 2022


Author: Nikolas Klauser
Date: 2022-05-24T09:09:31-04:00
New Revision: 55e34f3b49b1485d57ba2e4b8cd88af8f7900f61

URL: https://github.com/llvm/llvm-project/commit/55e34f3b49b1485d57ba2e4b8cd88af8f7900f61
DIFF: https://github.com/llvm/llvm-project/commit/55e34f3b49b1485d57ba2e4b8cd88af8f7900f61.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

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

(cherry picked from commit b177a90ce7b590dfce6479142f46fd1b9554a3b3)

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/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 5f1fa834d4099..e16343591cdac 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 // !defined(_LIBCPP_HAS_NO_CONCEPTS)

diff  --git a/libcxx/include/__ranges/data.h b/libcxx/include/__ranges/data.h
index f8d92cbc75204..f97ec80332976 100644
--- a/libcxx/include/__ranges/data.h
+++ b/libcxx/include/__ranges/data.h
@@ -24,7 +24,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_HAS_NO_CONCEPTS) && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES)
+#if !defined(_LIBCPP_HAS_NO_CONCEPTS)
 
 // [range.prim.data]
 
@@ -99,7 +99,7 @@ inline namespace __cpo {
 } // namespace __cpo
 } // 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/__ranges/size.h b/libcxx/include/__ranges/size.h
index 2b71c03fb3996..e1aaf7eba898e 100644
--- a/libcxx/include/__ranges/size.h
+++ b/libcxx/include/__ranges/size.h
@@ -24,7 +24,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 {
   template<class>
@@ -128,7 +128,7 @@ inline namespace __cpo {
 } // namespace __cpo
 } // 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/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/ranges/range.access/data.pass.cpp b/libcxx/test/std/ranges/range.access/data.pass.cpp
index d7d87e2eb0415..3e26ea28b2a6e 100644
--- a/libcxx/test/std/ranges/range.access/data.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/data.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
 
 // 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 2cfa2ad37dfbe..40eb413a6d6a0 100644
--- a/libcxx/test/std/ranges/range.access/size.pass.cpp
+++ b/libcxx/test/std/ranges/range.access/size.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
 
 // 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 1c0559f44c2a1..93442d3eaf503 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
@@ -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 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 4d38351c420ee..b82c60c28ac83 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
@@ -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 T>
 // concept input_iterator;


        


More information about the llvm-branch-commits mailing list