diff --git a/test/std-format-test.cc b/test/std-format-test.cc index e23d8df4..7ee6e8c4 100644 --- a/test/std-format-test.cc +++ b/test/std-format-test.cc @@ -126,11 +126,11 @@ template <> struct std::formatter { if constexpr (!is_integral_v) throw format_error("width is not integral"); // else if (value < 0 || value > numeric_limits::max()) - else if (fmt::internal::is_negative(value) < 0 || + else if (fmt::internal::is_negative(value) || value > numeric_limits::max()) throw format_error("invalid width"); else - return value; + return static_cast(value); }, ctx.arg(width_arg_id)); return format_to(ctx.out(), "{0:{1}}", s.value, width);