diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 979ec12ff0..701df4a06b 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -2937,8 +2937,8 @@ static void checkValidDateTime(QDateTimeData &d) static void setTimeSpec(QDateTimeData &d, Qt::TimeSpec spec, int offsetSeconds) { auto status = getStatus(d); - status &= ~(QDateTimePrivate::ValidDateTime | QDateTimePrivate::DaylightMask | - QDateTimePrivate::TimeSpecMask); + status &= ~(uint(QDateTimePrivate::ValidDateTime) | uint(QDateTimePrivate::DaylightMask) | + uint(QDateTimePrivate::TimeSpecMask)); switch (spec) { case Qt::OffsetFromUTC: