From f9ceefb0fe88bcfdc204be7b9126715156341d99 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 19 Jul 2019 14:18:10 +0200 Subject: [PATCH] Fix a warning and is_negative usage --- test/std-format-test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);