From bbaff6277977ecaf6bd03b76d0c8ff5e6b05e57a Mon Sep 17 00:00:00 2001 From: NylteJ <178683943+NylteJ@users.noreply.github.com> Date: Tue, 2 Dec 2025 23:35:01 +0800 Subject: [PATCH 1/2] Fix incorrect `noexcept` specification of `_Debug_lt_pred` --- stl/inc/xutility | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stl/inc/xutility b/stl/inc/xutility index 6abbcf17771..98c338e1f36 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1730,14 +1730,14 @@ constexpr bool _Enable_debug_lt_pred_order_check = is_same_v<_Remove_cvref_t<_Ty template > constexpr bool _Debug_lt_pred_order_check_noexcept = - noexcept(_STD declval<_Pr&>()(_STD declval<_Ty2&>(), _STD declval<_Ty1&>())); + noexcept(!_STD declval<_Pr&>()(_STD declval<_Ty2&>(), _STD declval<_Ty1&>())); template constexpr bool _Debug_lt_pred_order_check_noexcept<_Pr, _Ty1, _Ty2, false> = true; template -_NODISCARD constexpr bool _Debug_lt_pred(_Pr&& _Pred, _Ty1&& _Left, _Ty2&& _Right) - noexcept(noexcept(_Pred(_Left, _Right)) && _Debug_lt_pred_order_check_noexcept<_Pr, _Ty1, _Ty2>) { +_NODISCARD constexpr bool _Debug_lt_pred(_Pr&& _Pred, _Ty1&& _Left, _Ty2&& _Right) noexcept( + noexcept(static_cast(_Pred(_Left, _Right))) && _Debug_lt_pred_order_check_noexcept<_Pr, _Ty1, _Ty2>) { const auto _Result = static_cast(_Pred(_Left, _Right)); if constexpr (_Enable_debug_lt_pred_order_check<_Pr, _Ty1, _Ty2>) { From 71aa8f3da208d75444bfcac4d77bca7976d28630 Mon Sep 17 00:00:00 2001 From: NylteJ <178683943+NylteJ@users.noreply.github.com> Date: Wed, 3 Dec 2025 12:44:04 +0800 Subject: [PATCH 2/2] Fix incorrect `noexcept`, again --- stl/inc/xutility | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/xutility b/stl/inc/xutility index 98c338e1f36..53a64c6c787 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -1730,7 +1730,7 @@ constexpr bool _Enable_debug_lt_pred_order_check = is_same_v<_Remove_cvref_t<_Ty template > constexpr bool _Debug_lt_pred_order_check_noexcept = - noexcept(!_STD declval<_Pr&>()(_STD declval<_Ty2&>(), _STD declval<_Ty1&>())); + noexcept(static_cast(_STD declval<_Pr&>()(_STD declval<_Ty2&>(), _STD declval<_Ty1&>()))); template constexpr bool _Debug_lt_pred_order_check_noexcept<_Pr, _Ty1, _Ty2, false> = true; @@ -1742,7 +1742,7 @@ _NODISCARD constexpr bool _Debug_lt_pred(_Pr&& _Pred, _Ty1&& _Left, _Ty2&& _Righ if constexpr (_Enable_debug_lt_pred_order_check<_Pr, _Ty1, _Ty2>) { if (_Result) { - _STL_VERIFY(!_Pred(_Right, _Left), "invalid comparator"); + _STL_VERIFY(!static_cast(_Pred(_Right, _Left)), "invalid comparator"); } }