[libcxx-commits] [libcxx] fa3e262 - [libcxx][iterator][ranges] adds `forward_iterator` and `forward_range`
Christopher Di Bella via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 3 13:47:18 PDT 2021
Author: Christopher Di Bella
Date: 2021-05-03T20:46:18Z
New Revision: fa3e26266cd499856c573b68bee97fefc07f24ad
URL: https://github.com/llvm/llvm-project/commit/fa3e26266cd499856c573b68bee97fefc07f24ad
DIFF: https://github.com/llvm/llvm-project/commit/fa3e26266cd499856c573b68bee97fefc07f24ad.diff
LOG: [libcxx][iterator][ranges] adds `forward_iterator` and `forward_range`
Implements parts of:
* P0896R4 The One Ranges Proposal`
Depends on D100271.
Differential Revision: https://reviews.llvm.org/D100275
Added:
libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/forward_iterator.compile.pass.cpp
libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/subsumption.compile.pass.cpp
libcxx/test/std/ranges/range.refinements/forward_range.compile.pass.cpp
Modified:
libcxx/include/__iterator/concepts.h
libcxx/include/__ranges/concepts.h
libcxx/include/iterator
libcxx/include/ranges
libcxx/test/std/containers/associative/map/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/associative/multimap/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/associative/multiset/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/associative/set/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/array/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/deque/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/forwardlist/forwardlist.iter/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/list/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/vector/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.map/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.multiset/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.set/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/views/range_concept_conformance.compile.pass.cpp
libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/input.output/filesystems/class.directory_iterator/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.cpp
libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp
libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/ranges/range.refinements/subsumption.compile.pass.cpp
libcxx/test/std/re/re.iter/re.regiter/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/re/re.iter/re.tokiter/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp
libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp
libcxx/test/std/strings/basic.string/string.iterators/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/strings/string.view/range_concept_conformance.compile.pass.cpp
libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
Removed:
libcxx/test/libcxx/iterators/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp
################################################################################
diff --git a/libcxx/include/__iterator/concepts.h b/libcxx/include/__iterator/concepts.h
index 9ea1d16a7d2a..3e6022b7cd8f 100644
--- a/libcxx/include/__iterator/concepts.h
+++ b/libcxx/include/__iterator/concepts.h
@@ -119,6 +119,14 @@ concept input_iterator =
requires { typename _ITER_CONCEPT<_Ip>; } &&
derived_from<_ITER_CONCEPT<_Ip>, input_iterator_tag>;
+// [iterator.concept.forward]
+template<class _Ip>
+concept forward_iterator =
+ input_iterator<_Ip> &&
+ derived_from<_ITER_CONCEPT<_Ip>, forward_iterator_tag> &&
+ incrementable<_Ip> &&
+ sentinel_for<_Ip, _Ip>;
+
// clang-format on
#endif // !defined(_LIBCPP_HAS_NO_RANGES)
diff --git a/libcxx/include/__ranges/concepts.h b/libcxx/include/__ranges/concepts.h
index 8f2f467e9878..36e6739e1851 100644
--- a/libcxx/include/__ranges/concepts.h
+++ b/libcxx/include/__ranges/concepts.h
@@ -54,8 +54,12 @@ namespace ranges {
template <class _Tp>
concept input_range = range<_Tp> && input_iterator<iterator_t<_Tp> >;
+ template <class _Tp>
+ concept forward_range = input_range<_Tp> && forward_iterator<iterator_t<_Tp> >;
+
template <class _Tp>
concept common_range = range<_Tp> && same_as<iterator_t<_Tp>, sentinel_t<_Tp> >;
+
} // namespace ranges
#endif // !defined(_LIBCPP_HAS_NO_RANGES)
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index d759eae914ac..78f67ddf2229 100644
--- a/libcxx/include/iterator
+++ b/libcxx/include/iterator
@@ -79,6 +79,10 @@ template<class S, class I>
template<class I>
concept input_iterator = see below; // since C++20
+// [iterator.concept.forward], concept forward_iterator
+template<class I>
+ concept forward_iterator = see below; // since C++20
+
template<class Category, class T, class Distance = ptr
diff _t,
class Pointer = T*, class Reference = T&>
struct iterator
diff --git a/libcxx/include/ranges b/libcxx/include/ranges
index ca9f648921dc..58b67f1d086e 100644
--- a/libcxx/include/ranges
+++ b/libcxx/include/ranges
@@ -51,6 +51,9 @@ namespace std::ranges {
template<class T>
concept input_range = see below;
+ template<class T>
+ concept forward_range = see below;
+
template <class _Tp>
concept common_range = see below;
}
diff --git a/libcxx/test/std/containers/associative/map/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/map/iterator_concept_conformance.compile.pass.cpp
index 576118f3b893..a833200a17c0 100644
--- a/libcxx/test/std/containers/associative/map/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::map<int, int>::reverse_iterator;
using const_reverse_iterator = std::map<int, int>::const_reverse_iterator;
using value_type = std::pair<const int, int>;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -34,12 +32,9 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<const_iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
diff --git a/libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp
index 7a9e34cf435d..998227d0e0de 100644
--- a/libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/associative/multimap/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/multimap/iterator_concept_conformance.compile.pass.cpp
index ab74dfc436c6..1693fa076d6e 100644
--- a/libcxx/test/std/containers/associative/multimap/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::multimap<int, int>::reverse_iterator;
using const_reverse_iterator = std::multimap<int, int>::const_reverse_iterator;
using value_type = std::pair<const int, int>;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -34,12 +32,9 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<const_iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
diff --git a/libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp
index 45c422f13a2c..dde9ba12f73a 100644
--- a/libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/associative/multiset/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/multiset/iterator_concept_conformance.compile.pass.cpp
index 0487700b6805..1c88b557dab3 100644
--- a/libcxx/test/std/containers/associative/multiset/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::multiset<int>::reverse_iterator;
using const_reverse_iterator = std::multiset<int>::const_reverse_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -34,11 +32,10 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
+static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
diff --git a/libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp
index eb97b282f7b6..b5c8e2459b90 100644
--- a/libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/associative/set/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/associative/set/iterator_concept_conformance.compile.pass.cpp
index 55539b427924..f5f92a997906 100644
--- a/libcxx/test/std/containers/associative/set/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::set<int>::reverse_iterator;
using const_reverse_iterator = std::set<int>::const_reverse_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -34,12 +32,9 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
diff --git a/libcxx/test/std/containers/sequences/array/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/array/iterator_concept_conformance.compile.pass.cpp
index 6eec05716c60..846c0e39890f 100644
--- a/libcxx/test/std/containers/sequences/array/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/iterator_concept_conformance.compile.pass.cpp
@@ -21,10 +21,8 @@ using const_iterator = std::array<int, 10>::const_iterator;
using reverse_iterator = std::array<int, 10>::reverse_iterator;
using const_reverse_iterator = std::array<int, 10>::const_reverse_iterator;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(std::indirectly_writable<iterator, int>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -34,10 +32,8 @@ static_assert(std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, int>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
@@ -46,4 +42,3 @@ static_assert(std::sized_sentinel_for<const_iterator, iterator>);
static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<const_iterator>);
diff --git a/libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp
index 05ed9e1d621b..cdb245ba71f0 100644
--- a/libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/sequences/deque/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/deque/iterator_concept_conformance.compile.pass.cpp
index a401e2d38d65..d5d455eda13e 100644
--- a/libcxx/test/std/containers/sequences/deque/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::deque<int>::reverse_iterator;
using const_reverse_iterator = std::deque<int>::const_reverse_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -35,10 +33,8 @@ static_assert(std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
@@ -47,4 +43,3 @@ static_assert(std::sized_sentinel_for<const_iterator, iterator>);
static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<const_iterator>);
diff --git a/libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp
index 881e8232f422..afb76778141f 100644
--- a/libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.iter/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.iter/iterator_concept_conformance.compile.pass.cpp
index 9b7d36fb68ba..fae264870619 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/forwardlist.iter/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/forwardlist.iter/iterator_concept_conformance.compile.pass.cpp
@@ -20,22 +20,16 @@ using iterator = std::forward_list<int>::iterator;
using const_iterator = std::forward_list<int>::const_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<const_iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
-static_assert(std::input_iterator<const_iterator>);
diff --git a/libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp
index 5203a238d9e8..19fe3537163a 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/sequences/list/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/list/iterator_concept_conformance.compile.pass.cpp
index 8566ec9a6002..e2b60ce74157 100644
--- a/libcxx/test/std/containers/sequences/list/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::list<int>::reverse_iterator;
using const_reverse_iterator = std::list<int>::const_reverse_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -34,12 +32,9 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
@@ -48,4 +43,3 @@ static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<const_iterator>);
diff --git a/libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp
index abb58f58beb4..c83185036b6f 100644
--- a/libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp
index 7aa8cb41cb73..33203170e716 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::vector<bool>::reverse_iterator;
using const_reverse_iterator = std::vector<bool>::const_reverse_iterator;
using value_type = bool;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -35,10 +33,8 @@ static_assert(std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
@@ -47,4 +43,3 @@ static_assert(std::sized_sentinel_for<const_iterator, iterator>);
static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<const_iterator>);
diff --git a/libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp
index d00394d17c25..3fe82de40598 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/sequences/vector/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/iterator_concept_conformance.compile.pass.cpp
index c72eee746f79..8f676705047e 100644
--- a/libcxx/test/std/containers/sequences/vector/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::vector<int>::reverse_iterator;
using const_reverse_iterator = std::vector<int>::const_reverse_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -35,10 +33,8 @@ static_assert(std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
@@ -47,4 +43,3 @@ static_assert(std::sized_sentinel_for<const_iterator, iterator>);
static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<const_iterator>);
diff --git a/libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp
index 425d516fcf18..ab8005427d65 100644
--- a/libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/unord/unord.map/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/iterator_concept_conformance.compile.pass.cpp
index 58311bd2437b..1bc67b21ccdc 100644
--- a/libcxx/test/std/containers/unord/unord.map/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using local_iterator = std::unordered_map<int, int>::local_iterator;
using const_local_iterator = std::unordered_map<int, int>::const_local_iterator;
using value_type = std::pair<const int, int>;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, local_iterator>);
@@ -34,12 +32,9 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_local_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, local_iterator>);
@@ -48,12 +43,9 @@ static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_iterator>);
-static_assert(std::indirectly_readable<local_iterator>);
+static_assert(std::forward_iterator<local_iterator>);
static_assert(!std::indirectly_writable<local_iterator, value_type>);
-static_assert(std::incrementable<local_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<local_iterator, iterator>);
static_assert(!std::sentinel_for<local_iterator, const_iterator>);
static_assert(std::sentinel_for<local_iterator, local_iterator>);
@@ -62,12 +54,9 @@ static_assert(!std::sized_sentinel_for<local_iterator, iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<local_iterator>);
-static_assert(std::indirectly_readable<const_local_iterator>);
+static_assert(std::forward_iterator<const_local_iterator>);
static_assert(!std::indirectly_writable<const_local_iterator, value_type>);
-static_assert(std::incrementable<const_local_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<const_local_iterator, iterator>);
static_assert(!std::sentinel_for<const_local_iterator, const_iterator>);
static_assert(std::sentinel_for<const_local_iterator, local_iterator>);
@@ -76,4 +65,3 @@ static_assert(!std::sized_sentinel_for<const_local_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_local_iterator>);
diff --git a/libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp
index d3b98a7c8734..a62ca693f00b 100644
--- a/libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/unord/unord.multimap/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/iterator_concept_conformance.compile.pass.cpp
index 8033a9163ee3..a53edc95a2c6 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using local_iterator = std::unordered_multimap<int, int>::local_iterator;
using const_local_iterator = std::unordered_multimap<int, int>::const_local_iterator;
using value_type = std::pair<const int, int>;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, local_iterator>);
@@ -34,12 +32,9 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_local_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, local_iterator>);
@@ -48,12 +43,9 @@ static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_iterator>);
-static_assert(std::indirectly_readable<local_iterator>);
+static_assert(std::forward_iterator<local_iterator>);
static_assert(!std::indirectly_writable<local_iterator, value_type>);
-static_assert(std::incrementable<local_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<local_iterator, iterator>);
static_assert(!std::sentinel_for<local_iterator, const_iterator>);
static_assert(std::sentinel_for<local_iterator, local_iterator>);
@@ -62,12 +54,9 @@ static_assert(!std::sized_sentinel_for<local_iterator, iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<local_iterator>);
-static_assert(std::indirectly_readable<const_local_iterator>);
+static_assert(std::forward_iterator<const_local_iterator>);
static_assert(!std::indirectly_writable<const_local_iterator, value_type>);
-static_assert(std::incrementable<const_local_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<const_local_iterator, iterator>);
static_assert(!std::sentinel_for<const_local_iterator, const_iterator>);
static_assert(std::sentinel_for<const_local_iterator, local_iterator>);
@@ -76,4 +65,3 @@ static_assert(!std::sized_sentinel_for<const_local_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_local_iterator>);
diff --git a/libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp
index 4f0e40352050..2418b0f0fa95 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/unord/unord.multiset/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/iterator_concept_conformance.compile.pass.cpp
index 5a0cfb58016f..c1b05fe57b22 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using local_iterator = std::unordered_multiset<int>::local_iterator;
using const_local_iterator = std::unordered_multiset<int>::const_local_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, local_iterator>);
@@ -34,12 +32,9 @@ static_assert(!std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_local_iterator>);
-static_assert(std::input_iterator<iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, local_iterator>);
@@ -48,12 +43,9 @@ static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_iterator>);
-static_assert(std::indirectly_readable<local_iterator>);
+static_assert(std::forward_iterator<local_iterator>);
static_assert(!std::indirectly_writable<local_iterator, value_type>);
-static_assert(std::incrementable<local_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<local_iterator, iterator>);
static_assert(!std::sentinel_for<local_iterator, const_iterator>);
static_assert(std::sentinel_for<local_iterator, local_iterator>);
@@ -62,12 +54,9 @@ static_assert(!std::sized_sentinel_for<local_iterator, iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<local_iterator>);
-static_assert(std::indirectly_readable<const_local_iterator>);
+static_assert(std::forward_iterator<const_local_iterator>);
static_assert(!std::indirectly_writable<const_local_iterator, value_type>);
-static_assert(std::incrementable<const_local_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(!std::sentinel_for<const_local_iterator, iterator>);
static_assert(!std::sentinel_for<const_local_iterator, const_iterator>);
static_assert(std::sentinel_for<const_local_iterator, local_iterator>);
@@ -76,4 +65,3 @@ static_assert(!std::sized_sentinel_for<const_local_iterator, iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, local_iterator>);
static_assert(!std::sized_sentinel_for<const_local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_local_iterator>);
diff --git a/libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp
index 9d42fb73afd0..8d34570890d1 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/unord/unord.set/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.set/iterator_concept_conformance.compile.pass.cpp
index 447b3ebf6798..01e36e191fe5 100644
--- a/libcxx/test/std/containers/unord/unord.set/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/iterator_concept_conformance.compile.pass.cpp
@@ -22,39 +22,45 @@ using local_iterator = std::unordered_set<int>::local_iterator;
using const_local_iterator = std::unordered_set<int>::const_local_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, local_iterator>);
static_assert(!std::sentinel_for<iterator, const_local_iterator>);
-static_assert(std::input_iterator<iterator>);
+static_assert(!std::sized_sentinel_for<iterator, iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<iterator, const_local_iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
+static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, local_iterator>);
static_assert(!std::sentinel_for<const_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_iterator, const_local_iterator>);
-static_assert(std::indirectly_readable<local_iterator>);
-static_assert(std::incrementable<local_iterator>);
-static_assert(std::input_or_output_iterator<local_iterator>);
+static_assert(std::forward_iterator<local_iterator>);
static_assert(!std::sentinel_for<local_iterator, iterator>);
static_assert(!std::sentinel_for<local_iterator, const_iterator>);
static_assert(std::sentinel_for<local_iterator, local_iterator>);
static_assert(std::sentinel_for<local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<local_iterator, const_local_iterator>);
-static_assert(std::indirectly_readable<const_local_iterator>);
+static_assert(std::forward_iterator<const_local_iterator>);
static_assert(!std::indirectly_writable<const_local_iterator, value_type>);
-static_assert(std::incrementable<const_local_iterator>);
-static_assert(std::input_or_output_iterator<const_local_iterator>);
static_assert(!std::sentinel_for<const_local_iterator, iterator>);
static_assert(!std::sentinel_for<const_local_iterator, const_iterator>);
static_assert(std::sentinel_for<const_local_iterator, local_iterator>);
static_assert(std::sentinel_for<const_local_iterator, const_local_iterator>);
-static_assert(std::input_iterator<const_local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, local_iterator>);
+static_assert(!std::sized_sentinel_for<const_local_iterator, const_local_iterator>);
diff --git a/libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp
index 7806ce05f807..e792ce052d64 100644
--- a/libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::const_iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/views/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/views/range_concept_conformance.compile.pass.cpp
index a94cdbf1327c..53f4e9082ec4 100644
--- a/libcxx/test/std/containers/views/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/views/range_concept_conformance.compile.pass.cpp
@@ -22,8 +22,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<range>, range::iterator>);
static_assert(stdr::common_range<range>);
-static_assert(stdr::input_range<range>);
+static_assert(stdr::forward_range<range>);
static_assert(std::same_as<stdr::iterator_t<range const>, range::iterator>);
static_assert(stdr::common_range<range const>);
-static_assert(stdr::input_range<range const>);
+static_assert(stdr::forward_range<range const>);
diff --git a/libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
index 5e0f16a93c06..55d5c3856931 100644
--- a/libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/containers/views/span.iterators/iterator_concept_conformance.compile.pass.cpp
@@ -20,12 +20,9 @@ using iterator = std::span<int>::iterator;
using reverse_iterator = std::span<int>::reverse_iterator;
using value_type = int;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
static_assert(std::sized_sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
-static_assert(std::input_iterator<iterator>);
diff --git a/libcxx/test/std/input.output/filesystems/class.directory_iterator/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/input.output/filesystems/class.directory_iterator/iterator_concept_conformance.compile.pass.cpp
index 6c3ee5a27c4f..63ab32c0f031 100644
--- a/libcxx/test/std/input.output/filesystems/class.directory_iterator/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.directory_iterator/iterator_concept_conformance.compile.pass.cpp
@@ -18,20 +18,16 @@
using value_type = fs::directory_entry;
-static_assert(std::indirectly_readable<fs::directory_iterator>);
+static_assert(std::input_iterator<fs::directory_iterator>);
+static_assert(!std::forward_iterator<fs::directory_iterator>);
static_assert(!std::indirectly_writable<fs::directory_iterator, value_type>);
-static_assert(std::weakly_incrementable<fs::directory_iterator>);
static_assert(!std::incrementable<fs::directory_iterator>);
-static_assert(std::input_or_output_iterator<fs::directory_iterator>);
static_assert(std::sentinel_for<fs::directory_iterator, fs::directory_iterator>);
static_assert(!std::sized_sentinel_for<fs::directory_iterator, fs::directory_iterator>);
-static_assert(std::input_iterator<fs::directory_iterator>);
-static_assert(std::indirectly_readable<fs::recursive_directory_iterator>);
+static_assert(std::input_iterator<fs::recursive_directory_iterator>);
+static_assert(!std::forward_iterator<fs::recursive_directory_iterator>);
static_assert(!std::indirectly_writable<fs::recursive_directory_iterator, value_type>);
-static_assert(std::weakly_incrementable<fs::recursive_directory_iterator>);
static_assert(!std::incrementable<fs::recursive_directory_iterator>);
-static_assert(std::input_or_output_iterator<fs::recursive_directory_iterator>);
static_assert(std::sentinel_for<fs::recursive_directory_iterator, fs::recursive_directory_iterator>);
static_assert(!std::sized_sentinel_for<fs::recursive_directory_iterator, fs::recursive_directory_iterator>);
-static_assert(std::input_iterator<fs::recursive_directory_iterator>);
diff --git a/libcxx/test/std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.cpp
index 3cb551ac3632..6f22e25da77a 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/range_concept_conformance.compile.pass.cpp
@@ -21,8 +21,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<fs::path>, fs::path::iterator>);
static_assert(stdr::common_range<fs::path>);
-static_assert(stdr::input_range<fs::path>);
+static_assert(stdr::forward_range<fs::path>);
static_assert(std::same_as<stdr::iterator_t<fs::path const>, fs::path::const_iterator>);
static_assert(stdr::common_range<fs::path const>);
-static_assert(stdr::input_range<fs::path const>);
+static_assert(stdr::forward_range<fs::path const>);
diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/forward_iterator.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/forward_iterator.compile.pass.cpp
new file mode 100644
index 000000000000..61eb3eac25af
--- /dev/null
+++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/forward_iterator.compile.pass.cpp
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+// UNSUPPORTED: gcc-10
+
+// std::forward_iterator;
+
+#include <iterator>
+
+#include <concepts>
+
+#include "test_iterators.h"
+
+static_assert(!std::forward_iterator<cpp17_input_iterator<int*> >);
+static_assert(!std::forward_iterator<cpp20_input_iterator<int*> >);
+static_assert(std::forward_iterator<forward_iterator<int*> >);
+static_assert(std::forward_iterator<bidirectional_iterator<int*> >);
+static_assert(std::forward_iterator<random_access_iterator<int*> >);
+static_assert(std::forward_iterator<contiguous_iterator<int*> >);
+
+static_assert(std::forward_iterator<int*>);
+static_assert(std::forward_iterator<int const*>);
+static_assert(std::forward_iterator<int volatile*>);
+static_assert(std::forward_iterator<int const volatile*>);
+
+struct not_input_iterator {
+ // using value_type = int;
+ using
diff erence_type = std::ptr
diff _t;
+ using iterator_concept = std::forward_iterator_tag;
+
+ int operator*() const;
+
+ not_input_iterator& operator++();
+ not_input_iterator operator++(int);
+
+ bool operator==(not_input_iterator const&) const = default;
+};
+static_assert(std::input_or_output_iterator<not_input_iterator>);
+static_assert(!std::input_iterator<not_input_iterator>);
+static_assert(!std::forward_iterator<not_input_iterator>);
+
+struct bad_iterator_tag {
+ using value_type = int;
+ using
diff erence_type = std::ptr
diff _t;
+ using iterator_concept = std::input_iterator_tag;
+
+ int operator*() const;
+
+ bad_iterator_tag& operator++();
+ bad_iterator_tag operator++(int);
+
+ bool operator==(bad_iterator_tag const&) const = default;
+};
+static_assert(!std::forward_iterator<bad_iterator_tag>);
+
+struct not_incrementable {
+ using value_type = int;
+ using
diff erence_type = std::ptr
diff _t;
+ using iterator_concept = std::forward_iterator_tag;
+
+ int operator*() const;
+
+ not_incrementable& operator++();
+ void operator++(int);
+
+ bool operator==(not_incrementable const&) const = default;
+};
+static_assert(!std::forward_iterator<not_incrementable>);
+
+struct not_equality_comparable {
+ using value_type = int;
+ using
diff erence_type = std::ptr
diff _t;
+ using iterator_concept = std::forward_iterator_tag;
+
+ int operator*() const;
+
+ not_equality_comparable& operator++();
+ not_equality_comparable operator++(int);
+
+ bool operator==(not_equality_comparable const&) const = delete;
+};
+static_assert(!std::forward_iterator<not_equality_comparable>);
diff --git a/libcxx/test/libcxx/iterators/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/subsumption.compile.pass.cpp
similarity index 78%
rename from libcxx/test/libcxx/iterators/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp
rename to libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/subsumption.compile.pass.cpp
index 41c7c7e6e8bf..f1b7f304e40d 100644
--- a/libcxx/test/libcxx/iterators/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.forward/subsumption.compile.pass.cpp
@@ -10,22 +10,19 @@
// UNSUPPORTED: libcpp-no-concepts
// UNSUPPORTED: gcc-10
-// template<class T>
-// concept input_iterator;
+// std::forward_iterator;
#include <iterator>
#include <concepts>
// clang-format off
-template<std::input_or_output_iterator I>
-requires std::indirectly_readable<I> &&
- std::derived_from<std::_ITER_CONCEPT<I>, std::input_iterator_tag>
+template<std::input_iterator>
[[nodiscard]] constexpr bool check_subsumption() {
return false;
}
-template<std::input_iterator>
+template<std::forward_iterator>
[[nodiscard]] constexpr bool check_subsumption() {
return true;
}
diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp
index 3a18b8a25f94..608a7d006e54 100644
--- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp
+++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp
@@ -1 +1,33 @@
-// Due to the need to check _ITER_CONCEPT, this test is located in `test/libcxx/iterators/iterator.concepts/iterator.concept.input/subsumption.compile.pass.cpp`.
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+// UNSUPPORTED: gcc-10
+
+// template<class T>
+// concept input_iterator;
+
+#include <iterator>
+
+#include <concepts>
+
+// clang-format off
+template<std::input_or_output_iterator I>
+requires std::indirectly_readable<I>
+[[nodiscard]] constexpr bool check_subsumption() {
+ return false;
+}
+
+template<std::input_iterator>
+[[nodiscard]] constexpr bool check_subsumption() {
+ return true;
+}
+// clang-format on
+
+static_assert(check_subsumption<int*>());
diff --git a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
index 185f04b0a569..e239ce10c75b 100644
--- a/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/move.iterators/move.iterator/iterator_concept_conformance.compile.pass.cpp
@@ -15,10 +15,11 @@
#include <iterator>
using iterator = std::move_iterator<int*>;
-static_assert(std::indirectly_readable<iterator>);
+
+
+static_assert(std::input_iterator<iterator>);
+static_assert(!std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, int>);
static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sized_sentinel_for<iterator, iterator>);
-static_assert(std::input_iterator<iterator>);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
index ea8d0208ce2d..4144617e233e 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
@@ -14,16 +14,28 @@
#include <iterator>
-using iterator = std::reverse_iterator<int*>;
-
-static_assert(std::indirectly_readable<iterator>);
-static_assert(std::indirectly_writable<iterator, int>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
-static_assert(std::sentinel_for<iterator, iterator>);
-static_assert(std::sized_sentinel_for<iterator, iterator>);
-static_assert(std::input_iterator<iterator>);
-
-using other_iterator = std::reverse_iterator<float*>;
-static_assert(std::sentinel_for<iterator, other_iterator>);
-static_assert(!std::sized_sentinel_for<iterator, other_iterator>);
+#include "test_iterators.h"
+
+template<class I1>
+[[nodiscard]] consteval bool common_reverse_iterator_checks() {
+ static_assert(std::indirectly_writable<I1, int>);
+ static_assert(std::sentinel_for<I1, I1>);
+ static_assert(std::sentinel_for<I1, std::reverse_iterator<float*>>);
+ static_assert(!std::sized_sentinel_for<I1, std::reverse_iterator<float*>>);
+ return true;
+}
+
+using reverse_bidirectional_iterator = std::reverse_iterator<bidirectional_iterator<int*>>;
+static_assert(common_reverse_iterator_checks<reverse_bidirectional_iterator>());
+static_assert(std::forward_iterator<reverse_bidirectional_iterator>);
+static_assert(!std::sized_sentinel_for<reverse_bidirectional_iterator, reverse_bidirectional_iterator>);
+
+using reverse_random_access_iterator = std::reverse_iterator<random_access_iterator<int*>>;
+static_assert(common_reverse_iterator_checks<reverse_random_access_iterator>());
+static_assert(std::forward_iterator<reverse_random_access_iterator>);
+static_assert(std::sized_sentinel_for<reverse_random_access_iterator, reverse_random_access_iterator>);
+
+using reverse_contiguous_iterator = std::reverse_iterator<contiguous_iterator<int*>>;
+static_assert(common_reverse_iterator_checks<reverse_contiguous_iterator>());
+static_assert(std::forward_iterator<reverse_contiguous_iterator>);
+static_assert(std::sized_sentinel_for<reverse_contiguous_iterator, reverse_contiguous_iterator>);
diff --git a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/iterator_concept_conformance.compile.pass.cpp
index e953563f0726..765d5b250fc3 100644
--- a/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/istreambuf.iterator/iterator_concept_conformance.compile.pass.cpp
@@ -18,11 +18,10 @@
#include <string>
using iterator = std::istreambuf_iterator<char>;
-static_assert(std::indirectly_readable<iterator>);
+
+static_assert(std::input_iterator<iterator>);
+static_assert(!std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, char>);
-static_assert(std::weakly_incrementable<iterator>);
static_assert(!std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(!std::sized_sentinel_for<iterator, iterator>);
-static_assert(std::input_iterator<iterator>);
diff --git a/libcxx/test/std/ranges/range.refinements/forward_range.compile.pass.cpp b/libcxx/test/std/ranges/range.refinements/forward_range.compile.pass.cpp
new file mode 100644
index 000000000000..1a58f1fac408
--- /dev/null
+++ b/libcxx/test/std/ranges/range.refinements/forward_range.compile.pass.cpp
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+// UNSUPPORTED: gcc-10
+
+// std::ranges::forward_range;
+
+#include <ranges>
+
+#include "test_iterators.h"
+#include "test_range.h"
+
+namespace stdr = std::ranges;
+
+template <template <class...> class I>
+constexpr bool check_forward_range() {
+ constexpr bool result = stdr::forward_range<test_range<I> >;
+ static_assert(stdr::forward_range<test_range<I> const> == result);
+ static_assert(stdr::forward_range<test_non_const_common_range<I> > == result);
+ static_assert(stdr::forward_range<test_non_const_range<I> > == result);
+ static_assert(stdr::forward_range<test_common_range<I> > == result);
+ static_assert(stdr::forward_range<test_common_range<I> const> == result);
+ static_assert(!stdr::forward_range<test_non_const_common_range<I> const>);
+ static_assert(!stdr::forward_range<test_non_const_range<I> const>);
+ return result;
+}
+
+static_assert(!check_forward_range<cpp17_input_iterator>());
+static_assert(!check_forward_range<cpp20_input_iterator>());
+static_assert(check_forward_range<forward_iterator>());
+static_assert(check_forward_range<bidirectional_iterator>());
+static_assert(check_forward_range<random_access_iterator>());
+static_assert(check_forward_range<contiguous_iterator>());
diff --git a/libcxx/test/std/ranges/range.refinements/subsumption.compile.pass.cpp b/libcxx/test/std/ranges/range.refinements/subsumption.compile.pass.cpp
index 5f3519ef988b..0480557a4f13 100644
--- a/libcxx/test/std/ranges/range.refinements/subsumption.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.refinements/subsumption.compile.pass.cpp
@@ -13,6 +13,8 @@
// template<class T>
// concept input_iterator;
+// std::ranges::forward_range
+
#include <ranges>
#include <iterator>
@@ -37,3 +39,19 @@ requires true
// clang-format on
static_assert(check_input_range_subsumption<range>());
+
+// clang-format off
+template<std::ranges::input_range R>
+requires std::forward_iterator<std::ranges::iterator_t<R> >
+[[nodiscard]] constexpr bool check_forward_range_subsumption() {
+ return false;
+}
+
+template<std::ranges::forward_range>
+requires true
+[[nodiscard]] constexpr bool check_forward_range_subsumption() {
+ return true;
+}
+// clang-format on
+
+static_assert(check_forward_range_subsumption<range>());
diff --git a/libcxx/test/std/re/re.iter/re.regiter/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/re/re.iter/re.regiter/iterator_concept_conformance.compile.pass.cpp
index 2512ec9b1497..b37640bfd338 100644
--- a/libcxx/test/std/re/re.iter/re.regiter/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.regiter/iterator_concept_conformance.compile.pass.cpp
@@ -16,10 +16,7 @@
#include <iterator>
-static_assert(std::indirectly_readable<std::cregex_iterator>);
+static_assert(std::forward_iterator<std::cregex_iterator>);
static_assert(!std::indirectly_writable<std::cregex_iterator, char>);
-static_assert(std::incrementable<std::cregex_iterator>);
-static_assert(std::input_or_output_iterator<std::cregex_iterator>);
static_assert(std::sentinel_for<std::cregex_iterator, std::cregex_iterator>);
static_assert(!std::sized_sentinel_for<std::cregex_iterator, std::cregex_iterator>);
-static_assert(std::input_iterator<std::cregex_iterator>);
diff --git a/libcxx/test/std/re/re.iter/re.tokiter/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/re/re.iter/re.tokiter/iterator_concept_conformance.compile.pass.cpp
index 4f68d642a736..b3e69d5448fe 100644
--- a/libcxx/test/std/re/re.iter/re.tokiter/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/re/re.iter/re.tokiter/iterator_concept_conformance.compile.pass.cpp
@@ -16,10 +16,7 @@
#include <iterator>
-static_assert(std::indirectly_readable<std::cregex_token_iterator>);
+static_assert(std::forward_iterator<std::cregex_token_iterator>);
static_assert(!std::indirectly_writable<std::cregex_token_iterator, char>);
-static_assert(std::incrementable<std::cregex_token_iterator>);
-static_assert(std::input_or_output_iterator<std::cregex_token_iterator>);
static_assert(std::sentinel_for<std::cregex_token_iterator, std::cregex_token_iterator>);
static_assert(!std::sized_sentinel_for<std::cregex_token_iterator, std::cregex_token_iterator>);
-static_assert(std::input_iterator<std::cregex_token_iterator>);
diff --git a/libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp
index e743f7cdb01a..2bc1f75b5210 100644
--- a/libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp
@@ -21,8 +21,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<std::cmatch>, std::cmatch::iterator>);
static_assert(stdr::common_range<std::cmatch>);
-static_assert(stdr::input_range<std::cmatch>);
+static_assert(stdr::forward_range<std::cmatch>);
static_assert(std::same_as<stdr::iterator_t<std::cmatch const>, std::cmatch::const_iterator>);
static_assert(stdr::common_range<std::cmatch const>);
-static_assert(stdr::input_range<std::cmatch const>);
+static_assert(stdr::forward_range<std::cmatch const>);
diff --git a/libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp
index 18b0a1dfaaf8..4605cfd4a1bc 100644
--- a/libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp
@@ -21,8 +21,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<std::string>, std::string::iterator>);
static_assert(stdr::common_range<std::string>);
-static_assert(stdr::input_range<std::string>);
+static_assert(stdr::forward_range<std::string>);
static_assert(std::same_as<stdr::iterator_t<std::string const>, std::string::const_iterator>);
static_assert(stdr::common_range<std::string const>);
-static_assert(stdr::input_range<std::string const>);
+static_assert(stdr::forward_range<std::string const>);
diff --git a/libcxx/test/std/strings/basic.string/string.iterators/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/strings/basic.string/string.iterators/iterator_concept_conformance.compile.pass.cpp
index 19c480e31322..2777b1fec0c9 100644
--- a/libcxx/test/std/strings/basic.string/string.iterators/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.iterators/iterator_concept_conformance.compile.pass.cpp
@@ -22,10 +22,8 @@ using reverse_iterator = std::string::reverse_iterator;
using const_reverse_iterator = std::string::const_reverse_iterator;
using value_type = char;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(std::indirectly_writable<iterator, value_type>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -35,9 +33,8 @@ static_assert(std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, value_type>);
-static_assert(std::incrementable<const_iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
@@ -46,4 +43,3 @@ static_assert(std::sized_sentinel_for<const_iterator, iterator>);
static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<const_iterator>);
diff --git a/libcxx/test/std/strings/string.view/range_concept_conformance.compile.pass.cpp b/libcxx/test/std/strings/string.view/range_concept_conformance.compile.pass.cpp
index 8957db244d96..f4ee18b0c34c 100644
--- a/libcxx/test/std/strings/string.view/range_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/strings/string.view/range_concept_conformance.compile.pass.cpp
@@ -21,8 +21,8 @@ namespace stdr = std::ranges;
static_assert(std::same_as<stdr::iterator_t<std::string_view>, std::string_view::iterator>);
static_assert(stdr::common_range<std::string_view>);
-static_assert(stdr::input_range<std::string_view>);
+static_assert(stdr::forward_range<std::string_view>);
static_assert(std::same_as<stdr::iterator_t<std::string_view const>, std::string_view::const_iterator>);
static_assert(stdr::common_range<std::string_view const>);
-static_assert(stdr::input_range<std::string_view const>);
+static_assert(stdr::forward_range<std::string_view const>);
diff --git a/libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp b/libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
index 6effb1f69d3d..db8d8be9fbf8 100644
--- a/libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.iterators/iterator_concept_conformance.compile.pass.cpp
@@ -21,10 +21,8 @@ using const_iterator = std::string_view::const_iterator;
using reverse_iterator = std::string_view::reverse_iterator;
using const_reverse_iterator = std::string_view::const_reverse_iterator;
-static_assert(std::indirectly_readable<iterator>);
+static_assert(std::forward_iterator<iterator>);
static_assert(!std::indirectly_writable<iterator, char>);
-static_assert(std::incrementable<iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<iterator, iterator>);
static_assert(std::sentinel_for<iterator, const_iterator>);
static_assert(!std::sentinel_for<iterator, reverse_iterator>);
@@ -34,10 +32,8 @@ static_assert(std::sized_sentinel_for<iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
-static_assert(std::indirectly_readable<const_iterator>);
+static_assert(std::forward_iterator<const_iterator>);
static_assert(!std::indirectly_writable<const_iterator, char>);
-static_assert(std::incrementable<const_iterator>);
-static_assert(std::input_or_output_iterator<iterator>);
static_assert(std::sentinel_for<const_iterator, iterator>);
static_assert(std::sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
@@ -46,4 +42,3 @@ static_assert(std::sized_sentinel_for<const_iterator, iterator>);
static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
-static_assert(std::input_iterator<const_iterator>);
More information about the libcxx-commits
mailing list