[libcxx-commits] [PATCH] D131419: [NFC][libc++][test] Removes unneeded code.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 8 10:57:59 PDT 2022


Mordante created this revision.
Mordante added a reviewer: mumbleskates.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

In D130295 <https://reviews.llvm.org/D130295> @mumbleskates wondered why `std::strong_ordering::equal` had
special code since it's the same as `std::strong_ordering::equivalent`.

This is indeed the case so the special case can be removed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131419

Files:
  libcxx/test/support/test_comparisons.h


Index: libcxx/test/support/test_comparisons.h
===================================================================
--- libcxx/test/support/test_comparisons.h
+++ libcxx/test/support/test_comparisons.h
@@ -139,9 +139,6 @@
 template <class Order, class T, class U = T>
 constexpr bool testOrder(const T& t1, const U& t2, Order order) {
     bool equal = order == Order::equivalent;
-    if constexpr (std::same_as<Order, std::strong_ordering>)
-        equal |= order == Order::equal;
-
     bool less = order == Order::less;
 
     return (t1 <=> t2 == order) && testComparisons(t1, t2, equal, less);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131419.450878.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220808/b339e0d0/attachment.bin>


More information about the libcxx-commits mailing list