Index: libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/associative/map/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::map; @@ -27,7 +29,11 @@ static_assert(!std::ranges::random_access_range); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/associative/multimap/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::multimap; @@ -27,7 +29,11 @@ static_assert(!std::ranges::random_access_range); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/associative/multiset/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::multiset; static_assert(std::same_as, range::iterator>); @@ -26,7 +28,11 @@ static_assert(!std::ranges::random_access_range); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/associative/set/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::set; @@ -28,7 +30,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::bidirectional_range); Index: libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/sequences/array/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::array; @@ -27,7 +29,11 @@ static_assert(std::ranges::contiguous_range); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(!std::ranges::view); static_assert(std::same_as, range::const_iterator>); Index: libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/sequences/deque/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::deque; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/sequences/forwardlist/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::forward_list; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(!std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/sequences/list/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::list; @@ -27,7 +29,11 @@ static_assert(!std::ranges::random_access_range); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/sequences/vector.bool/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::vector; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/sequences/vector/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::vector; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/unord/unord.map/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::unordered_map; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/unord/unord.multimap/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::unordered_multimap; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/unord/unord.multiset/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::unordered_multiset; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/containers/unord/unord.set/range_concept_conformance.compile.pass.cpp @@ -17,6 +17,8 @@ #include #include +#include "test_macros.h" + using range = std::unordered_set; @@ -27,7 +29,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, range::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp @@ -114,7 +114,11 @@ assert(std::ranges::begin(ref) == globalBuff + 2); assert(std::ranges::end(ref) == globalBuff + 8); +#if _LIBCPP_VERSION static_assert(!std::is_invocable_v); +#else // ^^^ before P2415 / after P2415 vvv + ASSERT_SAME_TYPE(decltype(std::views::all(std::move(range))), std::ranges::owning_view); +#endif // _LIBCPP_VERSION } { @@ -128,16 +132,25 @@ { auto subrange = std::views::all(BorrowableRange(2)); - static_assert(!noexcept(std::views::all(BorrowableRange(2)))); + LIBCPP_STATIC_ASSERT(!noexcept(std::views::all(BorrowableRange(2)))); +#if _LIBCPP_VERSION ASSERT_SAME_TYPE(decltype(subrange), std::ranges::subrange); +#else // ^^^ before P2415 / after P2415 + ASSERT_SAME_TYPE(decltype(subrange), std::ranges::owning_view); +#endif // _LIBCPP_VERSION assert(std::ranges::begin(subrange) == globalBuff + 2); assert(std::ranges::end(subrange) == globalBuff + 8); } { auto subrange = std::views::all(RandomAccessRange()); +#if _LIBCPP_VERSION ASSERT_SAME_TYPE(decltype(subrange), std::ranges::subrange, RandomAccessRange::sentinel>); +#else // ^^^ before P2415 / after P2415 + ASSERT_SAME_TYPE(decltype(subrange), + std::ranges::owning_view); +#endif // _LIBCPP_VERSION assert(std::ranges::begin(subrange).base() == globalBuff); assert(std::ranges::end(subrange) == std::ranges::begin(subrange) + 8); } Index: libcxx/test/std/ranges/range.adaptors/range.all/all_t.compile.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.all/all_t.compile.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.all/all_t.compile.pass.cpp @@ -36,6 +36,11 @@ ASSERT_SAME_TYPE(std::views::all_t, std::ranges::ref_view); ASSERT_SAME_TYPE(std::views::all_t, std::ranges::ref_view); +#ifdef _LIBCPP_VERSION // Otherwise, returns subrange, sentinel_t> ASSERT_SAME_TYPE(std::views::all_t, std::ranges::subrange, sentinel>); ASSERT_SAME_TYPE(std::views::all_t, std::ranges::subrange, sentinel>); +#else // ^^^ before P2415 / after P2415 vvv +ASSERT_SAME_TYPE(std::views::all_t, std::ranges::owning_view); +static_assert(!std::ranges::viewable_range); +#endif // _LIBCPP_VERSION Index: libcxx/test/std/ranges/range.adaptors/range.common.view/ctad.compile.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.common.view/ctad.compile.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.common.view/ctad.compile.pass.cpp @@ -52,9 +52,16 @@ decltype(std::ranges::common_view(br)), std::ranges::common_view> >); +#ifdef _LIBCPP_VERSION static_assert(std::same_as< decltype(std::ranges::common_view(std::move(br))), std::ranges::common_view, std::ranges::subrange_kind::unsized>> >); +#else // ^^^ before P2415 / after P2415 vvv + static_assert(std::same_as< + decltype(std::ranges::common_view(std::move(br))), + std::ranges::common_view> + >); +#endif // _LIBCPP_VERSION } Index: libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.drop/ctad.compile.pass.cpp @@ -28,5 +28,10 @@ static_assert(std::same_as(), 0)), ranges::drop_view>>); +#ifdef _LIBCPP_VERSION static_assert(std::same_as>>); +#else // ^^^ Before P2415 / After P2415 vvv +static_assert(std::same_as>>); +#endif // _LIBCPP_VERSION Index: libcxx/test/std/ranges/range.adaptors/range.reverse/ctad.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.reverse/ctad.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.reverse/ctad.pass.cpp @@ -63,8 +63,13 @@ (void)x; } { +#ifdef _LIBCPP_VERSION using Subrange = std::ranges::subrange, std::ranges::subrange_kind::unsized>; std::same_as> auto x = std::ranges::reverse_view(std::move(br)); +#else // ^^^ Before P2415 / After P2415 vvv + std::same_as>> auto x = + std::ranges::reverse_view(std::move(br)); +#endif (void)x; } Index: libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.take/ctad.compile.pass.cpp @@ -60,9 +60,16 @@ decltype(std::ranges::take_view(br, 0)), std::ranges::take_view> >); +#ifdef _LIBCPP_VERSION static_assert(std::same_as< decltype(std::ranges::take_view(std::move(br), 0)), std::ranges::take_view, std::ranges::subrange_kind::unsized>> >); +#else // ^^^ before P2415 / after P2415 + static_assert(std::same_as< + decltype(std::ranges::take_view(std::move(br), 0)), + std::ranges::take_view> + >); +#endif // _LIBCPP_VERSION } Index: libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp +++ libcxx/test/std/ranges/range.adaptors/range.transform/ctad.compile.pass.cpp @@ -22,5 +22,10 @@ std::ranges::transform_view>); static_assert(std::same_as(), PlusOne())), std::ranges::transform_view, PlusOne>>); +#ifdef _LIBCPP_VERSION static_assert(std::same_as, PlusOne>>); +#else // ^^^ before P2415 / after P2415 vvv +static_assert(std::same_as, PlusOne>>); +#endif // _LIBCPP_VERSION Index: libcxx/test/std/ranges/range.req/range.refinements/viewable_range.compile.pass.cpp =================================================================== --- libcxx/test/std/ranges/range.req/range.refinements/viewable_range.compile.pass.cpp +++ libcxx/test/std/ranges/range.req/range.refinements/viewable_range.compile.pass.cpp @@ -98,8 +98,11 @@ static_assert(!std::ranges::view); static_assert(std::constructible_from); static_assert(!std::ranges::borrowed_range); - +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 vvv +static_assert(std::ranges::viewable_range); +#endif // _LIBCPP_VERSION // viewable_range is satisfied for (range=true, view=false, constructible_from=false, borrowed_range=true) struct T7 : test_range { Index: libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/re/re.results/range_concept_conformance.compile.pass.cpp @@ -17,7 +17,7 @@ #include #include - +#include "test_macros.h" static_assert(std::same_as, std::cmatch::iterator>); static_assert(std::ranges::common_range); @@ -26,7 +26,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, std::cmatch::const_iterator>); static_assert(std::ranges::common_range); Index: libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp =================================================================== --- libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp +++ libcxx/test/std/strings/basic.string/range_concept_conformance.compile.pass.cpp @@ -17,7 +17,7 @@ #include #include - +#include "test_macros.h" static_assert(std::same_as, std::string::iterator>); static_assert(std::ranges::common_range); @@ -26,7 +26,11 @@ static_assert(!std::ranges::view); static_assert(std::ranges::sized_range); static_assert(!std::ranges::borrowed_range); +#ifdef _LIBCPP_VERSION static_assert(!std::ranges::viewable_range); +#else // ^^^ pre-P2415 / post-P2415 +static_assert(std::ranges::viewable_range); +#endif static_assert(std::same_as, std::string::const_iterator>); static_assert(std::ranges::common_range);