diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h index c3b025c6b9..bbfc0ec9fc 100644 --- a/src/corelib/time/qdatetime.h +++ b/src/corelib/time/qdatetime.h @@ -155,7 +155,7 @@ private: { const auto epochDays = days.time_since_epoch().count(); // minJd() and maxJd() fit into 40 bits. - if constexpr (sizeof(epochDays) >= 41) { + if constexpr (sizeof(epochDays) * CHAR_BIT >= 41) { constexpr auto top = maxJd() - unixEpochJd(); constexpr auto bottom = minJd() - unixEpochJd(); if (epochDays > top || epochDays < bottom)