Workaround a gcc 9.1 bug (#2334)

This commit is contained in:
Victor Zverovich 2021-06-01 06:34:43 -07:00
parent 2dba1cfac1
commit 8c1b22ba6d
2 changed files with 2 additions and 4 deletions

View File

@ -148,8 +148,7 @@ template <> FMT_FUNC int count_digits<4>(detail::fallback_uintptr n) {
}
#if __cplusplus < 201703L
template <typename T>
constexpr const typename basic_data<T>::digit_pair basic_data<T>::digits[];
template <typename T> constexpr const char basic_data<T>::digits[][2];
template <typename T> constexpr const char basic_data<T>::hex_digits[];
template <typename T> constexpr const char basic_data<T>::signs[];
template <typename T> constexpr const unsigned basic_data<T>::prefixes[];

View File

@ -875,8 +875,7 @@ template <typename T = void> struct basic_data {
static const uint64_t log10_2_significand = 0x4d104d427de7fbcc;
// GCC generates slightly better code for pairs than chars.
using digit_pair = char[2];
FMT_API static constexpr const digit_pair digits[] = {
FMT_API static constexpr const char digits[][2] = {
{'0', '0'}, {'0', '1'}, {'0', '2'}, {'0', '3'}, {'0', '4'}, {'0', '5'},
{'0', '6'}, {'0', '7'}, {'0', '8'}, {'0', '9'}, {'1', '0'}, {'1', '1'},
{'1', '2'}, {'1', '3'}, {'1', '4'}, {'1', '5'}, {'1', '6'}, {'1', '7'},