diff --git a/libcxx/include/__ranges/concepts.h b/libcxx/include/__ranges/concepts.h --- a/libcxx/include/__ranges/concepts.h +++ b/libcxx/include/__ranges/concepts.h @@ -80,11 +80,11 @@ movable<_Tp> && enable_view<_Tp>; - template - concept __simple_view = - view<_Range> && range && - same_as, iterator_t> && - same_as, iterator_t>; + template + concept __simple_view = + view<_Range> && range && + same_as, iterator_t> && + same_as, sentinel_t>; // [range.refinements], other range refinements template diff --git a/libcxx/test/libcxx/ranges/range.utility.helpers/simple_view.compile.pass.cpp b/libcxx/test/libcxx/ranges/range.utility.helpers/simple_view.compile.pass.cpp --- a/libcxx/test/libcxx/ranges/range.utility.helpers/simple_view.compile.pass.cpp +++ b/libcxx/test/libcxx/ranges/range.utility.helpers/simple_view.compile.pass.cpp @@ -34,12 +34,19 @@ int *end(); }; -struct DifferentSentinel : std::ranges::view_base { +struct WithSentinel : std::ranges::view_base { int *begin() const; sentinel_wrapper end() const; }; +struct WrongConstSentinel : std::ranges::view_base { + int *begin() const; + sentinel_wrapper end(); + sentinel_wrapper end() const; +}; + static_assert( std::ranges::__simple_view); static_assert(!std::ranges::__simple_view); static_assert(!std::ranges::__simple_view); -static_assert(!std::ranges::__simple_view); +static_assert(std::ranges::__simple_view); +static_assert(!std::ranges::__simple_view);