diff --git a/stl/inc/__msvc_string_view.hpp b/stl/inc/__msvc_string_view.hpp index 303653318e3..da52a7dd839 100644 --- a/stl/inc/__msvc_string_view.hpp +++ b/stl/inc/__msvc_string_view.hpp @@ -475,7 +475,13 @@ struct _WChar_traits : private _Char_traits<_Elem, unsigned short> { }; _EXPORT_STD template -struct char_traits : _Char_traits<_Elem, long> {}; // properties of a string or stream unknown element +struct char_traits : _Char_traits<_Elem, long> { // properties of a string or stream unknown element +#ifndef _ALLOW_ANY_TYPE_STD_CHAR_TRAIS + static_assert(is_integral_v<_Elem>, + "Standard char_traits is only provided for char, wchar_t, char8_t, char16_t, and char32_t. " + "See N5032 [char.traits]. Visual C++ accepts other unsigned integral types as an extension."); +#endif // _ALLOW_ANY_TYPE_STD_CHAR_TRAIS +}; template <> struct char_traits : _WChar_traits {}; @@ -914,7 +920,7 @@ template class _String_bitmap<_Elem, false> { // _String_bitmap for wchar_t/unsigned short/char16_t/char32_t/etc. types public: static_assert(is_unsigned_v<_Elem>, "Standard char_traits is only provided for char, wchar_t, char8_t, char16_t, " - "and char32_t. See N4988 [char.traits]. " + "and char32_t. See N5032 [char.traits]. " "Visual C++ accepts other unsigned integral types as an extension."); constexpr bool _Mark(const _Elem* _First, const _Elem* const _Last) noexcept { diff --git a/tests/std/tests/Dev10_860410_bitset_ctors/env.lst b/tests/std/tests/Dev10_860410_bitset_ctors/env.lst index 19f025bd0e6..bcf68f4e5c5 100644 --- a/tests/std/tests/Dev10_860410_bitset_ctors/env.lst +++ b/tests/std/tests/Dev10_860410_bitset_ctors/env.lst @@ -2,3 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception RUNALL_INCLUDE ..\usual_matrix.lst +RUNALL_CROSSLIST +* PM_CL="/D_ALLOW_ANY_TYPE_STD_CHAR_TRAIS" diff --git a/tests/std/tests/P0980R1_constexpr_strings/env.lst b/tests/std/tests/P0980R1_constexpr_strings/env.lst index 351a8293d9d..b1d8b3f2277 100644 --- a/tests/std/tests/P0980R1_constexpr_strings/env.lst +++ b/tests/std/tests/P0980R1_constexpr_strings/env.lst @@ -2,3 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception RUNALL_INCLUDE ..\usual_20_matrix.lst +RUNALL_CROSSLIST +* PM_CL="/D_ALLOW_ANY_TYPE_STD_CHAR_TRAIS"