[libcxx-commits] [libcxx] [libc++] Add input validation for set_intersection() in debug mode. (PR #101508)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 12 08:11:21 PST 2024


================
@@ -43,33 +43,31 @@
 
 #include "test_iterators.h"
 
-namespace {
-
-// __debug_less will perform an additional comparison in an assertion
-static constexpr unsigned std_less_comparison_count_multiplier() noexcept {
-#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
-  return 2;
+// We don't check number of operations in Debug mode because they are not stable enough due to additional validations.
+#if defined(_LIBCPP_HARDENING_MODE_DEBUG) && _LIBCPP_HARDENING_MODE_DEBUG
----------------
ldionne wrote:

```suggestion
#if defined(_LIBCPP_VERSION) && _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
```

https://github.com/llvm/llvm-project/pull/101508


More information about the libcxx-commits mailing list