From 8455bb8a000cb5d6522dee01acf89c951b079de3 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 12 Mar 2023 10:43:12 +0000 Subject: [PATCH] Fix GCC6 compilation error in `count_digits` GCC6 appears to need the explicit return type there. Otherwise, it fails with: > error: use of 'fmt::v9::detail::count_digits(UInt):: [with int BITS = 4; UInt = long long unsigned int]' before deduction of 'auto' --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 7c607dbd..15f2ae92 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1107,7 +1107,7 @@ FMT_CONSTEXPR auto count_digits(UInt n) -> int { return (FMT_BUILTIN_CLZ(static_cast(n) | 1) ^ 31) / BITS + 1; #endif // Lambda avoids unreachable code warnings from NVHPC. - return [](UInt m) { + return [](UInt m) -> int { int num_digits = 0; do { ++num_digits;