Add support for code units > 0xFFFF in fill

This commit is contained in:
Victor Zverovich 2024-10-19 07:58:53 -07:00
parent 601be1cbe7
commit a16ff5787b

View File

@ -677,7 +677,8 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
auto num_chars_left = to_unsigned(s.data() + s.size() - p);
if (num_chars_left == 0) return;
FMT_ASSERT(num_chars_left < block_size, "");
// Suppress bogus -Wstringop-overflow.
if (FMT_GCC_VERSION) num_chars_left &= 3;
char buf[2 * block_size - 1] = {};
copy<char>(p, p + num_chars_left, buf);
const char* buf_ptr = buf;