From 55f62cd8ea9fb66ac741b99f9c11679d6f59b0db Mon Sep 17 00:00:00 2001 From: matrackif Date: Sun, 5 Dec 2021 16:54:56 +0100 Subject: [PATCH] Fix -Wshadow warning --- include/fmt/chrono.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 15cfa412..cae242a4 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -1595,20 +1595,21 @@ struct chrono_formatter { static constexpr auto fractional_width = detail::num_digits(Duration::period::num, Duration::period::den); - using precision = std::chrono::duration< + using subsecond_precision = std::chrono::duration< typename std::common_type::type, std::ratio<1, detail::pow10(fractional_width)>>; // We could use c++ 17 if constexpr here. - if (std::ratio_less::value) { *out++ = '.'; const auto subseconds = - std::chrono::treat_as_floating_point::value + std::chrono::treat_as_floating_point< + typename subsecond_precision::rep>::value ? (detail::abs(d) - std::chrono::duration_cast(d)) .count() - : std::chrono::duration_cast( + : std::chrono::duration_cast( detail::abs(d) - std::chrono::duration_cast(d)) .count();