[clang] [clang-tools-extra] [llvm] [libcxx] [libc++][hardening] Categorize assertions related to strict weak ordering (PR #77405)

Louis Dionne via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 12:38:05 PST 2024


================
@@ -53,10 +53,9 @@ struct __debug_less {
   _LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI void __do_compare_assert(long, _LHS&, _RHS&) {}
 };
 
-// Pass the comparator by lvalue reference. Or in debug mode, using a
-// debugging wrapper that stores a reference.
-#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
-template <class _Comp>
+// Pass the comparator by lvalue reference. Or in the extensive hardening mode and above, using a debugging wrapper that
+// stores a reference.
+#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_EXTENSIVE || _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
----------------
ldionne wrote:

Per @danlark1 's comment, I suggest we start by keeping this in the debug mode only. This is also the status quo, so it's more conservative.

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


More information about the llvm-commits mailing list