Suppress a useless warning (#2004)

This commit is contained in:
Victor Zverovich
2020-11-12 08:18:28 -08:00
parent 6d14f78115
commit 7abc3c01e0
2 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -685,7 +685,8 @@ inline bool isfinite(T value) {
// Converts value to int and checks that it's in the range [0, upper).
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
inline int to_nonnegative_int(T value, int upper) {
FMT_ASSERT(value >= 0 && value <= upper, "invalid value");
FMT_ASSERT(value >= 0 && to_unsigned(value) <= to_unsigned(upper),
"invalid value");
(void)upper;
return static_cast<int>(value);
}