Apply a masking of -1 of unsigned wchar_t
This commit is contained in:
parent
2f21f9b5fa
commit
bbe50ec0d7
@ -771,7 +771,10 @@ TEST(FormatterTest, SpaceSign) {
|
|||||||
|
|
||||||
TEST(FormatterTest, SignNotTruncated) {
|
TEST(FormatterTest, SignNotTruncated) {
|
||||||
wchar_t format_str[] = {L'{', L':',
|
wchar_t format_str[] = {L'{', L':',
|
||||||
'+' | static_case<wchar_t>(1 << fmt::detail::num_bits<char>()), L'}', 0};
|
'+' | static_cast<wchar_t>(
|
||||||
|
1 << fmt::detail::num_bits<char>()
|
||||||
|
& static_cast<typename std::make_unsigned_t<wchar_t> >(-1) ),
|
||||||
|
L'}', 0};
|
||||||
EXPECT_THROW(format(format_str, 42), format_error);
|
EXPECT_THROW(format(format_str, 42), format_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user