diff --git a/test/printf-test.cc b/test/printf-test.cc index 4f9167a4..8e840857 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -292,12 +292,11 @@ void TestLength(const char *length_spec, U value) { fmt::LongLong signed_value = value; fmt::ULongLong unsigned_value = value; // Apply integer promotion to the argument. - U max = std::numeric_limits::max(); - if (max <= std::numeric_limits::max()) { + fmt::ULongLong max = std::numeric_limits::max(); + if (max <= static_cast(std::numeric_limits::max())) { signed_value = static_cast(value); unsigned_value = static_cast(value); - } else if (static_cast(max) <= - std::numeric_limits::max()) { + } else if (max <= std::numeric_limits::max()) { signed_value = static_cast(value); unsigned_value = static_cast(value); }