diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 74fc8485..96a215da 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -2135,8 +2135,9 @@ struct formatter, auto format(std::chrono::time_point val, FormatContext& ctx) const -> decltype(ctx.out()) { using period = typename Duration::period; - if (period::num != 1 || period::den != 1 || - std::is_floating_point::value) { + if (detail::const_check( + period::num != 1 || period::den != 1 || + std::is_floating_point::value)) { const auto epoch = val.time_since_epoch(); auto subsecs = std::chrono::duration_cast( epoch - std::chrono::duration_cast(epoch));