value-initialise the buffer array member of detail::ansi_color_escape so that it can be used in a constexpr context in MSVC; compiler rejects as non-constant due to 'uninitialized symbol' otherwise (#4581)

Co-authored-by: Harry Denholm <ishani@users.noreply.github.com>
This commit is contained in:
Harry Denholm
2025-10-17 15:10:56 +00:00
committed by GitHub
parent 656d14db8b
commit 378a5ab3c1

View File

@@ -429,7 +429,7 @@ template <typename Char> struct ansi_color_escape {
private:
static constexpr size_t num_emphases = 8;
Char buffer[7u + 4u * num_emphases];
Char buffer[7u + 4u * num_emphases] = {};
size_t size = 0;
static FMT_CONSTEXPR void to_esc(uint8_t c, Char* out,