diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/cpo.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/cpo.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/cpo.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/cpo.pass.cpp @@ -63,7 +63,11 @@ std::ranges::zip_view>> decltype(auto) v2 = std::views::zip(v); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v, std::tuple>>); +#else + static_assert(std::is_same_v, std::tuple>>); +#endif } return true; } diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp @@ -50,10 +50,14 @@ View v = View(); // the default constructor is not explicit assert(v.size() == 3); auto it = v.begin(); - using Pair = std::pair; - assert(*it++ == Pair(buff[0], buff[0])); - assert(*it++ == Pair(buff[1], buff[1])); - assert(*it == Pair(buff[2], buff[2])); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet + using Value = std::pair; +#else + using Value = std::tuple; +#endif + assert(*it++ == Value(buff[0], buff[0])); + assert(*it++ == Value(buff[1], buff[1])); + assert(*it == Value(buff[2], buff[2])); } return true; diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp @@ -163,7 +163,12 @@ using Subrange = std::ranges::subrange; static_assert(!std::three_way_comparable); using R = std::ranges::zip_view; +#ifdef _LIBCPP_VERSION + // libc++ hasn't implemented LWG-3692 "zip_view::iterator's operator<=> is overconstrained" static_assert(!std::three_way_comparable>); +#else + static_assert(std::three_way_comparable>); +#endif int a[] = {1, 2, 3, 4}; int b[] = {5, 6, 7, 8, 9}; diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/deref.pass.cpp @@ -42,7 +42,11 @@ auto [x, y] = *it; assert(&x == &(a[0])); assert(&y == &(b[0])); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v>); +#else + static_assert(std::is_same_v>); +#endif x = 5; y = 0.1; @@ -66,7 +70,11 @@ auto it = v.begin(); assert(&(std::get<0>(*it)) == &(a[0])); assert(&(std::get<1>(*it)) == &(a[0])); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v>); +#else + static_assert(std::is_same_v>); +#endif } return true; } diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/member_types.compile.pass.cpp @@ -73,7 +73,11 @@ static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert(std::is_same_v); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v>); +#else + static_assert(std::is_same_v>); +#endif static_assert(HasIterCategory); } @@ -120,7 +124,11 @@ static_assert(std::is_same_v); static_assert(std::is_same_v); static_assert(std::is_same_v); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v>>); +#else + static_assert(std::is_same_v>>); +#endif static_assert(HasIterCategory); } @@ -161,7 +169,11 @@ // value_type of multiple views with different value_type std::ranges::zip_view v{foos, bars}; using Iter = decltype(v.begin()); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v>); +#else + static_assert(std::is_same_v>); +#endif } { diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/subscript.pass.cpp @@ -27,7 +27,11 @@ assert(it[2] == *(it + 2)); assert(it[4] == *(it + 4)); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v>); +#else + static_assert(std::is_same_v>); +#endif } { @@ -38,7 +42,11 @@ assert(it[2] == *(it + 2)); assert(it[4] == *(it + 4)); +#ifdef _LIBCPP_VERSION // libc++ doesn't implement P2165R4 yet static_assert(std::is_same_v>); +#else + static_assert(std::is_same_v>); +#endif } { diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/types.h b/libcxx/test/std/ranges/range.adaptors/range.zip/types.h --- a/libcxx/test/std/ranges/range.adaptors/range.zip/types.h +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/types.h @@ -319,7 +319,7 @@ } constexpr void operator++(int) { ++it_; } - constexpr int& operator*() const { return *it_; } + constexpr decltype(auto) operator*() const { return *it_; } friend constexpr bool operator==(common_input_iterator const&, common_input_iterator const&) = default; };