diff --git a/libqpdf/qpdf/QPDFObjectHandle_private.hh b/libqpdf/qpdf/QPDFObjectHandle_private.hh index 6cf3424..3e82bca 100644 --- a/libqpdf/qpdf/QPDFObjectHandle_private.hh +++ b/libqpdf/qpdf/QPDFObjectHandle_private.hh @@ -305,10 +305,10 @@ namespace qpdf explicit Integer(std::integral auto value) : Integer(static_cast(value)) { - if constexpr ( - std::numeric_limits::max() > - std::numeric_limits::max()) { - if (value > std::numeric_limits::max()) { + if constexpr (std::cmp_greater( + std::numeric_limits::max(), + std::numeric_limits::max())) { + if (std::cmp_greater(value, std::numeric_limits::max())) { throw std::overflow_error("overflow constructing Integer"); } }