[libcxx-commits] [PATCH] D150188: [libc++][spaceship] Fixed `__debug_three_way_comp`'s `operator()` for `vector<bool>'s `operator<=>`
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jun 9 08:55:41 PDT 2023
philnik accepted this revision.
philnik added a comment.
This revision is now accepted and ready to land.
LGTM % nit.
================
Comment at: libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.pass.cpp:158-165
+ int expected_compare_invocation_count = 3;
+#ifdef _LIBCPP_ENABLE_DEBUG_MODE
+ if (!std::is_constant_evaluated()) {
+ // In debug mode the comparator will be called twice by the debugging wrapper `__debug_three_way_comp`
+ expected_compare_invocation_count *= 2;
+ }
+#endif
----------------
It's at most that number of comparisons, so we shouldn't check for equality anyways.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150188/new/
https://reviews.llvm.org/D150188
More information about the libcxx-commits
mailing list