Hi! Here is an updated version of the __make_signed/__make_unsigned trait. Notable changes: 1) rebased on top of Arsen's quals changes 2) __make_unsigned_selector_base no longer defined when using compiler trait 3) uses __conditional_t in simd_details.h
Bootstrapped/regtested on x86_64-linux and i686-linux. 2026-11-12 Jakub Jelinek <[email protected]> gcc/cp/ * cp-trait.def (MAKE_SIGNED, MAKE_UNSIGNED): New traits. * semantics.cc (finish_make_signed): New function. (finish_trait_type): Handle CPTK_MAKE_SIGNED and CPTK_MAKE_UNSIGNED. * cp-tree.h (finish_make_signed): Declare. * reflect.cc (eval_make_signed): Use finish_make_signed. gcc/testsuite/ * g++.dg/ext/has-builtin-1.C: Add __has_builtin (__make_signed) and __has_builtin (__make_unsigned) tests. * g++.dg/ext/make_signed1.C: New test. * g++.dg/ext/make_signed2.C: New test. * g++.dg/ext/make_unsigned1.C: New test. * g++.dg/ext/make_unsigned2.C: New test. libstdc++-v3/ * include/std/type_traits (std::make_unsigned, std::make_signed): Use __make_unsigned and __make_signed traits if possible. * include/std/bit (std::byteswap): Use make_unsigned rather than __make_unsigned. * include/bits/simd_details.h (std::simd::__value_preserving_cast): Use __conditional_t<integral<_From>, make_unsigned<_From>, type_identity<_From>>::type instead of __make_unsigned<_From>::__type. * testsuite/24_iterators/range_access/range_access_cpp20_neg.cc: Adjust test for different diagnostics when using __make_signed/__make_unsigned traits. * testsuite/26_numerics/gcd/gcd_neg.cc: Likewise. * testsuite/26_numerics/lcm/lcm_neg.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise. * testsuite/23_containers/mdspan/extents/class_mandates_neg.cc: Likewise. --- a/gcc/cp/cp-trait.def 2026-11-07 14:27:47.468928971 +0100 +++ b/gcc/cp/cp-trait.def 2026-11-11 12:32:33.490622832 +0100 @@ -107,6 +107,8 @@ DEFTRAIT_EXPR (IS_UNBOUNDED_ARRAY, "__is DEFTRAIT_EXPR (IS_UNION, "__is_union", 1) DEFTRAIT_EXPR (IS_VIRTUAL_BASE_OF, "__builtin_is_virtual_base_of", 2) DEFTRAIT_EXPR (IS_VOLATILE, "__is_volatile", 1) +DEFTRAIT_TYPE (MAKE_SIGNED, "__make_signed", 1) +DEFTRAIT_TYPE (MAKE_UNSIGNED, "__make_unsigned", 1) DEFTRAIT_EXPR (RANK, "__array_rank", 1) DEFTRAIT_EXPR (REF_CONSTRUCTS_FROM_TEMPORARY, "__reference_constructs_from_temporary", 2) DEFTRAIT_EXPR (REF_CONVERTS_FROM_TEMPORARY, "__reference_converts_from_temporary", 2) --- a/gcc/cp/semantics.cc 2026-11-11 10:28:33.760006416 +0100 +++ b/gcc/cp/semantics.cc 2026-11-11 12:33:59.592518785 +0100 @@ -5345,6 +5345,55 @@ finish_underlying_type (tree type) return underlying_type; } +/* Implement the __make_signed and __make_unsigned keywords. */ + +tree +finish_make_signed (tree type, bool unsignedp, tsubst_flags_t complain) +{ + if (!INTEGRAL_TYPE_P (type) || TREE_CODE (type) == BOOLEAN_TYPE) + { + if (complain & tf_error) + error ("%<make_%ssigned%> on non-integral or %<bool%> type %qT", + unsignedp ? "un" : "", type); + return error_mark_node; + } + tree ret = type; + if (TREE_CODE (type) == ENUMERAL_TYPE + || TYPE_MAIN_VARIANT (type) == wchar_type_node + || TYPE_MAIN_VARIANT (type) == char8_type_node + || TYPE_MAIN_VARIANT (type) == char16_type_node + || TYPE_MAIN_VARIANT (type) == char32_type_node) + { + tree unit = TYPE_SIZE_UNIT (type); + tree types[] = { + signed_char_type_node, + short_integer_type_node, + integer_type_node, + long_integer_type_node, + long_long_integer_type_node }; + ret = NULL_TREE; + for (unsigned i = 0; i < ARRAY_SIZE (types); ++i) + if (tree_int_cst_equal (TYPE_SIZE_UNIT (types[i]), unit)) + { + ret = c_common_signed_or_unsigned_type (unsignedp, types[i]); + break; + } + if (!ret) + ret = c_common_type_for_size (TYPE_PRECISION (type), unsignedp); + } + else if (TYPE_MAIN_VARIANT (type) == char_type_node) + ret = unsignedp ? unsigned_char_type_node : signed_char_type_node; + else if (unsignedp ^ (!!TYPE_UNSIGNED (type))) + ret = c_common_signed_or_unsigned_type (unsignedp, type); + if (ret != type) + { + auto quals = cp_type_quals (type); + quals &= (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE); + ret = cp_build_qualified_type (ret, quals); + } + return ret; +} + /* Implement the __type_pack_element keyword: Return the type at index IDX within TYPES. */ @@ -15292,6 +15341,12 @@ finish_trait_type (cp_trait_kind kind, t case CPTK_UNDERLYING_TYPE: return finish_underlying_type (type1); + case CPTK_MAKE_SIGNED: + return finish_make_signed (type1, false, complain); + + case CPTK_MAKE_UNSIGNED: + return finish_make_signed (type1, true, complain); + #define DEFTRAIT_EXPR(CODE, NAME, ARITY) \ case CPTK_##CODE: #include "cp-trait.def" --- a/gcc/cp/cp-tree.h 2026-11-11 10:28:33.747006587 +0100 +++ b/gcc/cp/cp-tree.h 2026-11-11 12:32:33.493655185 +0100 @@ -8621,6 +8621,7 @@ extern cp_expr finish_id_expression (tr location_t); extern tree finish_typeof (tree); extern tree finish_underlying_type (tree); +extern tree finish_make_signed (tree, bool, tsubst_flags_t); extern tree calculate_bases (tree, tsubst_flags_t); extern tree finish_bases (tree, bool); extern tree calculate_direct_bases (tree, tsubst_flags_t); --- a/gcc/cp/reflect.cc 2026-11-11 10:28:33.759006429 +0100 +++ b/gcc/cp/reflect.cc 2026-11-11 12:33:46.246193804 +0100 @@ -5528,41 +5528,8 @@ eval_make_signed (location_t loc, const return throw_exception (loc, ctx, "reflection represents non-integral " "or bool type", fun, non_constant_p, jump_target); - tree ret = type; - if (TREE_CODE (type) == ENUMERAL_TYPE - || TYPE_MAIN_VARIANT (type) == wchar_type_node - || TYPE_MAIN_VARIANT (type) == char8_type_node - || TYPE_MAIN_VARIANT (type) == char16_type_node - || TYPE_MAIN_VARIANT (type) == char32_type_node) - { - tree unit = TYPE_SIZE_UNIT (type); - tree types[] = { - signed_char_type_node, - short_integer_type_node, - integer_type_node, - long_integer_type_node, - long_long_integer_type_node }; - ret = NULL_TREE; - for (unsigned i = 0; i < ARRAY_SIZE (types); ++i) - if (tree_int_cst_equal (TYPE_SIZE_UNIT (types[i]), unit)) - { - ret = c_common_signed_or_unsigned_type (unsignedp, types[i]); - break; - } - if (!ret) - ret = c_common_type_for_size (TYPE_PRECISION (type), unsignedp); - } - else if (TYPE_MAIN_VARIANT (type) == char_type_node) - ret = unsignedp ? unsigned_char_type_node : signed_char_type_node; - else if (unsignedp ^ (!!TYPE_UNSIGNED (type))) - ret = c_common_signed_or_unsigned_type (unsignedp, type); - if (ret != type) - { - auto quals = cp_type_quals (type); - quals &= (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE); - ret = cp_build_qualified_type (ret, quals); - } - else + tree ret = finish_make_signed (type, unsignedp, tf_warning_or_error); + if (ret == type) ret = strip_typedefs (type); return get_reflection_raw (loc, ret); } --- a/gcc/testsuite/g++.dg/ext/has-builtin-1.C 2026-11-07 14:27:47.475928878 +0100 +++ b/gcc/testsuite/g++.dg/ext/has-builtin-1.C 2026-11-11 12:32:33.496007213 +0100 @@ -38,6 +38,12 @@ #if !__has_builtin (__decay) # error "__has_builtin (__decay) failed" #endif +#if !__has_builtin (__make_signed) +# error "__has_builtin (__make_signed) failed" +#endif +#if !__has_builtin (__make_unsigned) +# error "__has_builtin (__make_unsigned) failed" +#endif #if !__has_builtin (__has_nothrow_assign) # error "__has_builtin (__has_nothrow_assign) failed" #endif --- a/gcc/testsuite/g++.dg/ext/make_signed1.C 2026-11-11 12:32:33.496184961 +0100 +++ b/gcc/testsuite/g++.dg/ext/make_signed1.C 2026-11-11 12:32:33.496184961 +0100 @@ -0,0 +1,50 @@ +// { dg-do compile { target c++11 } } + +enum E1 : int { E10, E11 }; +enum E2 : unsigned char { E20, E21 }; +enum E3 : short int { E30, E31 }; +enum E4 : long long { E40, E41 }; +#ifdef __SIZEOF_INT128__ +__extension__ using I128 = __int128; +__extension__ using U128 = unsigned __int128; +__extension__ enum E5 : I128 { E50, E51 }; +#endif +using T1 = int; + +static_assert (__is_same (__make_signed (const char), const signed char), ""); +static_assert (__is_same (__make_signed (volatile signed char), volatile signed char), ""); +static_assert (__is_same (__make_signed (unsigned char), signed char), ""); +static_assert (__is_same (__make_signed (const signed short), const short), ""); +static_assert (__is_same (__make_signed (volatile unsigned short), volatile signed short), ""); +static_assert (__is_same (__make_signed (int), signed int), ""); +static_assert (__is_same (__make_signed (const unsigned int), const int), ""); +static_assert (__is_same (__make_signed (volatile long), volatile signed long), ""); +static_assert (__is_same (__make_signed (unsigned long), long), ""); +static_assert (__is_same (__make_signed (const signed long long), const long long), ""); +static_assert (__is_same (__make_signed (volatile long long unsigned), volatile long long), ""); +#ifdef __SIZEOF_INT128__ +static_assert (__is_same (__make_signed (const I128), const I128), ""); +static_assert (__is_same (__make_signed (const volatile U128), const volatile I128), ""); +#endif +#if __SIZEOF_SHORT__ > 1 && __SIZEOF_SHORT__ < __SIZEOF_INT__ \ + && __SIZEOF_INT__ < __SIZEOF_LONG_LONG__ +static_assert (__is_same (__make_signed (const E1), const int), ""); +static_assert (__is_same (__make_signed (volatile E2), volatile signed char), ""); +static_assert (__is_same (__make_signed (E3), short), ""); +#if __SIZEOF_LONG__ < __SIZEOF_LONG_LONG__ +static_assert (__is_same (__make_signed (const volatile E4), const volatile long long), ""); +#else +static_assert (__is_same (__make_signed (const volatile E4), const volatile long), ""); +#endif +#if defined(__SIZEOF_INT128__) && __SIZEOF_LONG_LONG__ < __SIZEOF_INT128__ +static_assert (__is_same (__make_signed (const E5), const I128), ""); +#endif +#if __cpp_char8_t >= 202207L +static_assert (__is_same (__make_signed (volatile char8_t), volatile signed char), ""); +#endif +static_assert (sizeof (char16_t) != sizeof (short) || __is_same (__make_signed (char16_t), signed short), ""); +static_assert (sizeof (char32_t) != sizeof (int) || __is_same (__make_signed (const volatile char32_t), const volatile int), ""); +static_assert (sizeof (wchar_t) != sizeof (short) || __is_same (__make_signed (wchar_t), short), ""); +static_assert (sizeof (wchar_t) != sizeof (int) || __is_same (__make_signed (wchar_t), signed int), ""); +#endif +static_assert (__is_same (__make_signed (T1), int), ""); --- a/gcc/testsuite/g++.dg/ext/make_unsigned1.C 2026-11-11 12:32:33.496303377 +0100 +++ b/gcc/testsuite/g++.dg/ext/make_unsigned1.C 2026-11-11 12:32:33.496303377 +0100 @@ -0,0 +1,50 @@ +// { dg-do compile { target c++11 } } + +enum E1 : int { E10, E11 }; +enum E2 : unsigned char { E20, E21 }; +enum E3 : short int { E30, E31 }; +enum E4 : long long { E40, E41 }; +#ifdef __SIZEOF_INT128__ +__extension__ using I128 = __int128; +__extension__ using U128 = unsigned __int128; +__extension__ enum E5 : I128 { E50, E51 }; +#endif + +static_assert (__is_same (__make_unsigned (const char), const unsigned char), ""); +static_assert (__is_same (__make_unsigned (volatile signed char), volatile unsigned char), ""); +static_assert (__is_same (__make_unsigned (unsigned char), unsigned char), ""); +static_assert (__is_same (__make_unsigned (const signed short), const unsigned short), ""); +static_assert (__is_same (__make_unsigned (volatile unsigned short), volatile unsigned short), ""); +static_assert (__is_same (__make_unsigned (int), unsigned int), ""); +static_assert (__is_same (__make_unsigned (const unsigned int), const unsigned), ""); +static_assert (__is_same (__make_unsigned (volatile long), volatile unsigned long), ""); +static_assert (__is_same (__make_unsigned (unsigned long), unsigned long), ""); +static_assert (__is_same (__make_unsigned (const signed long long), const unsigned long long), ""); +static_assert (__is_same (__make_unsigned (volatile long long unsigned), volatile unsigned long long), ""); +#ifdef __SIZEOF_INT128__ +static_assert (__is_same (__make_unsigned (const I128), const U128), ""); +static_assert (__is_same (__make_unsigned (const volatile U128), const volatile U128), ""); +#endif +#if __SIZEOF_SHORT__ > 1 && __SIZEOF_SHORT__ < __SIZEOF_INT__ \ + && __SIZEOF_INT__ < __SIZEOF_LONG_LONG__ +static_assert (__is_same (__make_unsigned (const E1), const unsigned int), ""); +static_assert (__is_same (__make_unsigned (volatile E2), volatile unsigned char), ""); +static_assert (__is_same (__make_unsigned (E3), unsigned short), ""); +#if __SIZEOF_LONG__ < __SIZEOF_LONG_LONG__ +static_assert (__is_same (__make_unsigned (const volatile E4), const volatile unsigned long long), ""); +#else +static_assert (__is_same (__make_unsigned (const volatile E4), const volatile long unsigned), ""); +#endif +#if defined(__SIZEOF_INT128__) && __SIZEOF_LONG_LONG__ < __SIZEOF_INT128__ +static_assert (__is_same (__make_unsigned (const E5), const U128), ""); +#endif +#if __cpp_char8_t >= 202207L +static_assert (__is_same (__make_unsigned (volatile char8_t), volatile unsigned char), ""); +#endif +static_assert (sizeof (char16_t) != sizeof (short) || __is_same (__make_unsigned (char16_t), unsigned short), ""); +static_assert (sizeof (char32_t) != sizeof (int) || __is_same (__make_unsigned (const volatile char32_t), const volatile unsigned), ""); +static_assert (sizeof (wchar_t) != sizeof (short) || __is_same (__make_unsigned (wchar_t), unsigned short), ""); +static_assert (sizeof (wchar_t) != sizeof (int) || __is_same (__make_unsigned (wchar_t), unsigned int), ""); +#endif +using T4 = unsigned; +static_assert (__is_same (__make_unsigned (T4), unsigned), ""); --- a/gcc/testsuite/g++.dg/ext/make_signed2.C 2026-11-11 12:32:33.496438475 +0100 +++ b/gcc/testsuite/g++.dg/ext/make_signed2.C 2026-11-11 12:32:33.496438475 +0100 @@ -0,0 +1,10 @@ +// { dg-do compile { target c++11 } } + +struct S; +struct W { int w; }; +union U { int u; long v; }; +using A = __make_signed (S); // { dg-error "'make_signed' on non-integral or 'bool' type 'S'" } +using B = __make_signed (W); // { dg-error "'make_signed' on non-integral or 'bool' type 'W'" } +using C = __make_signed (U); // { dg-error "'make_signed' on non-integral or 'bool' type 'U'" } +using D = __make_signed (double); // { dg-error "'make_signed' on non-integral or 'bool' type 'double'" } +using E = __make_signed (const bool); // { dg-error "'make_signed' on non-integral or 'bool' type 'const bool'" } --- a/gcc/testsuite/g++.dg/ext/make_unsigned2.C 2026-11-11 12:32:33.496529172 +0100 +++ b/gcc/testsuite/g++.dg/ext/make_unsigned2.C 2026-11-11 12:32:33.496529172 +0100 @@ -0,0 +1,10 @@ +// { dg-do compile { target c++11 } } + +struct S; +struct W { int w; }; +union U { int u; long v; }; +using A = __make_unsigned (S); // { dg-error "'make_unsigned' on non-integral or 'bool' type 'S'" } +using B = __make_unsigned (W); // { dg-error "'make_unsigned' on non-integral or 'bool' type 'W'" } +using C = __make_unsigned (U); // { dg-error "'make_unsigned' on non-integral or 'bool' type 'U'" } +using D = __make_unsigned (double); // { dg-error "'make_unsigned' on non-integral or 'bool' type 'double'" } +using E = __make_unsigned (const bool); // { dg-error "'make_unsigned' on non-integral or 'bool' type 'const bool'" } --- a/libstdc++-v3/include/bits/simd_details.h 2026-11-07 14:27:47.476928865 +0100 +++ b/libstdc++-v3/include/bits/simd_details.h 2026-11-11 13:10:32.006430919 +0100 @@ -1323,7 +1323,9 @@ namespace simd static_assert(is_arithmetic_v<_From>); if constexpr (!__value_preserving_convertible_to<_From, _To>) { - using _Up = typename __make_unsigned<_From>::__type; + using _Up = typename __conditional_t<integral<_From>, + make_unsigned<_From>, + type_identity<_From>>::type; if (static_cast<_Up>(static_cast<_To>(__x)) != static_cast<_Up>(__x)) __glibcxx_on_bad_value_preserving_cast(); else if constexpr (is_signed_v<_From> && is_unsigned_v<_To>) --- a/libstdc++-v3/include/std/type_traits 2026-11-07 14:27:47.477928852 +0100 +++ b/libstdc++-v3/include/std/type_traits 2026-11-11 12:51:23.980787436 +0100 @@ -1960,6 +1960,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; // Utility for finding the unsigned versions of signed integral types. +#if !(_GLIBCXX_USE_BUILTIN_TRAIT(__make_unsigned) \ + && _GLIBCXX_USE_BUILTIN_TRAIT(__make_signed)) template<typename _Tp> struct __make_unsigned { using __type = _Tp; }; @@ -2112,12 +2114,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __type = typename __make_unsigned_selector<char32_t, false, true>::__type; }; +#endif /// @endcond // Given an integral/enum type, return the corresponding unsigned // integer type. // Primary template. /// make_unsigned +#if _GLIBCXX_USE_BUILTIN_TRAIT(__make_unsigned) \ + && _GLIBCXX_USE_BUILTIN_TRAIT(__make_signed) + template<typename _Tp> + struct make_unsigned + { using type = __make_unsigned(_Tp); }; +#else template<typename _Tp> struct make_unsigned { using type = typename __make_unsigned_selector<_Tp>::__type; }; @@ -2127,10 +2136,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<> struct make_unsigned<bool const>; template<> struct make_unsigned<bool volatile>; template<> struct make_unsigned<bool const volatile>; - +#endif /// @cond undocumented // Utility for finding the signed versions of unsigned integral types. +#if !(_GLIBCXX_USE_BUILTIN_TRAIT(__make_unsigned) \ + && _GLIBCXX_USE_BUILTIN_TRAIT(__make_signed)) template<typename _Tp> struct __make_signed { using __type = _Tp; }; @@ -2250,12 +2261,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __type = typename __make_signed_selector<char32_t, false, true>::__type; }; +#endif /// @endcond // Given an integral/enum type, return the corresponding signed // integer type. // Primary template. /// make_signed +#if _GLIBCXX_USE_BUILTIN_TRAIT(__make_unsigned) \ + && _GLIBCXX_USE_BUILTIN_TRAIT(__make_signed) + template<typename _Tp> + struct make_signed + { using type = __make_signed(_Tp); }; +#else template<typename _Tp> struct make_signed { using type = typename __make_signed_selector<_Tp>::__type; }; @@ -2265,6 +2283,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<> struct make_signed<bool const>; template<> struct make_signed<bool volatile>; template<> struct make_signed<bool const volatile>; +#endif #if __cplusplus > 201103L /// Alias template for make_signed --- a/libstdc++-v3/include/std/bit 2026-11-07 14:27:47.477928852 +0100 +++ b/libstdc++-v3/include/std/bit 2026-11-11 12:32:33.497771772 +0100 @@ -133,7 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif // Fallback implementation that handles even __int24 etc. - using _Up = typename __make_unsigned<__remove_cv_t<_Tp>>::__type; + using _Up = typename make_unsigned<__remove_cv_t<_Tp>>::type; size_t __diff = __CHAR_BIT__ * (sizeof(_Tp) - 1); _Up __mask1 = static_cast<unsigned char>(~0); _Up __mask2 = __mask1 << __diff; --- a/libstdc++-v3/testsuite/24_iterators/range_access/range_access_cpp20_neg.cc 2026-11-07 14:27:47.483928772 +0100 +++ b/libstdc++-v3/testsuite/24_iterators/range_access/range_access_cpp20_neg.cc 2026-11-11 12:32:33.498485457 +0100 @@ -35,7 +35,7 @@ test02() C c; std::ssize(c); // { dg-error "no matching function" } } -// { dg-error "incomplete type .*make_signed.*bool" "" { target *-*-* } 0 } +// { dg-error "incomplete type .*make_signed.*bool|'make_signed' on non-integral or 'bool' type 'bool'" "" { target *-*-* } 0 } void test03() @@ -45,4 +45,4 @@ test03() C c; std::ssize(c); // { dg-error "no matching function" } } -// { dg-error "incomplete type .*make_signed.*S" "" { target *-*-* } 0 } +// { dg-error "incomplete type .*make_signed.*S|'make_signed' on non-integral or 'bool' type 'test03\\\(\\\)::S'" "" { target *-*-* } 0 } --- a/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc 2026-11-07 14:27:47.485928746 +0100 +++ b/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc 2026-11-11 12:32:33.498754855 +0100 @@ -53,3 +53,4 @@ test01() // { dg-prune-output "does not have integral type" } // { dg-prune-output "non-integral type" } // { dg-prune-output "invalid specialization" } +// { dg-prune-output "'make_unsigned' on non-integral or 'bool' type" } --- a/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc 2026-11-07 14:27:47.485928746 +0100 +++ b/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc 2026-11-11 12:32:33.499026014 +0100 @@ -53,3 +53,5 @@ test01() // { dg-prune-output "does not have integral type" } // { dg-prune-output "non-integral type" } // { dg-prune-output "invalid specialization" } +// { dg-prune-output "make_unsigned' on non-integral or 'bool' type" } +// { dg-prune-output "argument 3 in call to function '__builtin_mul_overflow' has pointer to boolean type" } --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc 2026-11-07 14:27:47.480928812 +0100 +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc 2026-11-11 12:32:33.499191730 +0100 @@ -28,10 +28,10 @@ void test01() using std::make_unsigned; // Negative tests. - using T1 = make_unsigned<bool>::type; // { dg-error "incomplete" } - using T2 = make_unsigned<const bool>::type; // { dg-error "incomplete" } - using T3 = make_unsigned<volatile bool>::type; // { dg-error "incomplete" } - using T4 = make_unsigned<const volatile bool>::type; // { dg-error "incomplete" } + using T1 = make_unsigned<bool>::type; // { dg-error "incomplete|here" } + using T2 = make_unsigned<const bool>::type; // { dg-error "incomplete|here" } + using T3 = make_unsigned<volatile bool>::type; // { dg-error "incomplete|here" } + using T4 = make_unsigned<const volatile bool>::type; // { dg-error "incomplete|here" } using T5 = make_unsigned<pod_class>::type; // { dg-error "here" } @@ -43,4 +43,4 @@ void test01() using T8 = make_unsigned<float>::type; // { dg-error "here" } } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 0 } +// { dg-error "invalid use of incomplete type|'make_unsigned' on non-integral or 'bool' type" "" { target *-*-* } 0 } --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc 2026-11-07 14:27:47.480928812 +0100 +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc 2026-11-11 12:32:33.499305641 +0100 @@ -28,10 +28,10 @@ void test01() using std::make_signed; // Negative tests. - using T1 = make_signed<bool>::type; // { dg-error "incomplete" } - using T2 = make_signed<const bool>::type; // { dg-error "incomplete" } - using T3 = make_signed<volatile bool>::type; // { dg-error "incomplete" } - using T4 = make_signed<const volatile bool>::type; // { dg-error "incomplete" } + using T1 = make_signed<bool>::type; // { dg-error "incomplete|here" } + using T2 = make_signed<const bool>::type; // { dg-error "incomplete|here" } + using T3 = make_signed<volatile bool>::type; // { dg-error "incomplete|here" } + using T4 = make_signed<const volatile bool>::type; // { dg-error "incomplete|here" } using T5 = make_signed<pod_class>::type; // { dg-error "here" } @@ -43,4 +43,4 @@ void test01() using T8 = make_signed<float>::type; // { dg-error "here" } } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 0 } +// { dg-error "invalid use of incomplete type|'make_signed' on non-integral or 'bool' type" "" { target *-*-* } 0 } --- a/libstdc++-v3/testsuite/23_containers/mdspan/extents/class_mandates_neg.cc 2026-11-07 14:27:47.483928772 +0100 +++ b/libstdc++-v3/testsuite/23_containers/mdspan/extents/class_mandates_neg.cc 2026-11-11 12:32:33.499442004 +0100 @@ -15,3 +15,4 @@ std::extents<double, 1> e4; // { dg-prune-output "integer constants in boolean context" } // { dg-prune-output "__gnu_cxx::__numeric_traits_integer" } // { dg-prune-output "static assertion failed" } +// { dg-prune-output "'make_unsigned' on non-integral or 'bool' type" } Jakub
