From 12aa59c9c483f960beae52c49fd885d5684436fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=98=D0=B7?= =?UTF-8?q?=D0=B2=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Thu, 19 Sep 2024 23:13:47 +0300 Subject: [PATCH] fix-dispatch-locally --- libcxx/include/__algorithm/stable_sort.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcxx/include/__algorithm/stable_sort.h b/libcxx/include/__algorithm/stable_sort.h index 4d3f96ed849ddf..949ef95b5c9b87 100644 --- a/libcxx/include/__algorithm/stable_sort.h +++ b/libcxx/include/__algorithm/stable_sort.h @@ -24,6 +24,7 @@ #include <__type_traits/desugars_to.h> #include <__type_traits/enable_if.h> #include <__type_traits/is_integral.h> +#include <__type_traits/is_same.h> #include <__type_traits/is_trivially_assignable.h> #include <__type_traits/remove_cvref.h> #include <__utility/move.h> @@ -242,7 +243,8 @@ void __stable_sort(_RandomAccessIterator __first, #if _LIBCPP_STD_VER >= 17 constexpr auto __default_comp = __desugars_to_v<__totally_ordered_less_tag, __remove_cvref_t<_Compare>, value_type, value_type >; - constexpr auto __integral_value = is_integral_v; + constexpr auto __integral_value = + is_integral_v && is_same_v< value_type&, iter_reference_t<_RandomAccessIterator>>; constexpr auto __allowed_radix_sort = __default_comp && __integral_value; if constexpr (__allowed_radix_sort) { if (__len <= __buff_size && __len >= static_cast(__radix_sort_min_bound()) &&