[libcxx-commits] [PATCH] D113695: [libcxx] Implement three-way comparison for std::reverse_iterator

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 25 06:30:46 PST 2021


Quuxplusone accepted this revision as: Quuxplusone.
Quuxplusone added a comment.

LGTM! Please wait for second libc++ approval before landing.



================
Comment at: libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/three-way.pass.cpp:34
+    assert((l1 <=> r1) == x);
+}
+struct Iter {
----------------
Add a blank line between lines 34 and 35.


================
Comment at: libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/three-way.pass.cpp:87
+    test(Iter(0), ConstIter(nan), std::partial_ordering::unordered);
+    test(Iter(nan), Iter(6), std::partial_ordering::unordered);
+    test(ConstIter(0), Iter(1), std::partial_ordering::greater);
----------------
This is a known bug in GCC constexpr evaluation. You can just change this from `Iter(nan), Iter(6)` to `Iter(nan), Iter(nan)` and that should make GCC happy.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113695



More information about the libcxx-commits mailing list