Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions stl/inc/__msvc_string_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,13 @@ struct _WChar_traits : private _Char_traits<_Elem, unsigned short> {
};

_EXPORT_STD template <class _Elem>
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<char16_t> : _WChar_traits<char16_t> {};
Expand Down Expand Up @@ -914,7 +920,7 @@ template <class _Elem>
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 {
Expand Down
2 changes: 2 additions & 0 deletions tests/std/tests/Dev10_860410_bitset_ctors/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 2 additions & 0 deletions tests/std/tests/P0980R1_constexpr_strings/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -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"