Fix throw with exceptions disabled

This commit is contained in:
Vladislav Shchapov 2021-12-26 21:15:03 +05:00
parent 3014b3d770
commit 1057379edf

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);
}