[libcxx-commits] [PATCH] D141216: [libc++][test] zip_view test cleanups

Casey Carter via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 8 00:00:16 PST 2023


CaseyCarter updated this revision to Diff 487147.
CaseyCarter retitled this revision from "[libc++][test] Fix common_input_iterator" to "[libc++][test] zip_view test cleanups".
CaseyCarter edited the summary of this revision.
CaseyCarter added a comment.

Add another fix.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141216/new/

https://reviews.llvm.org/D141216

Files:
  libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
  libcxx/test/std/ranges/range.adaptors/range.zip/types.h


Index: libcxx/test/std/ranges/range.adaptors/range.zip/types.h
===================================================================
--- libcxx/test/std/ranges/range.adaptors/range.zip/types.h
+++ 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 auto& operator*() const { return *it_; }
 
   friend constexpr bool operator==(common_input_iterator const&, common_input_iterator const&) = default;
 };
Index: libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
===================================================================
--- libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
+++ libcxx/test/std/ranges/range.adaptors/range.zip/iterator/compare.pass.cpp
@@ -163,7 +163,12 @@
     using Subrange = std::ranges::subrange<It>;
     static_assert(!std::three_way_comparable<It>);
     using R = std::ranges::zip_view<Subrange, Subrange>;
+#ifdef _LIBCPP_VERSION
+    // libc++ hasn't implemented LWG-3692 "zip_view::iterator's operator<=> is overconstrained"
     static_assert(!std::three_way_comparable<std::ranges::iterator_t<R>>);
+#else
+    static_assert(std::three_way_comparable<std::ranges::iterator_t<R>>);
+#endif
 
     int a[] = {1, 2, 3, 4};
     int b[] = {5, 6, 7, 8, 9};


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141216.487147.patch
Type: text/x-patch
Size: 1378 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230108/c5334f60/attachment.bin>


More information about the libcxx-commits mailing list