Fix throw with exceptions disabled

This commit is contained in:
Vladislav Shchapov 2021-12-26 21:15:03 +05:00 committed by Victor Zverovich
parent 074c9c52ef
commit 3bbf2c673c

View File

@ -1404,7 +1404,7 @@ inline Int to_nonnegative_int(T value, Int upper) {
template <typename T, typename Int, FMT_ENABLE_IF(!std::is_integral<T>::value)>
inline Int to_nonnegative_int(T value, Int upper) {
if (value < 0 || value > static_cast<T>(upper))
throw format_error("invalid value");
FMT_THROW(format_error("invalid value"));
return static_cast<Int>(value);
}