Skip to content

Commit

Permalink
Workaround a gcc 9.1 bug (#2334)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jun 1, 2021
1 parent 2dba1cf commit 8c1b22b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
3 changes: 1 addition & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down

0 comments on commit 8c1b22b

Please sign in to comment.