Fix another compilation error in QDateTime

Similar fix as 538e9fa568 : gcc 7.5,
used e.g. on Jetson, is not able to resolve the add_overflow overload
without help.

Change-Id: I4d497480bb8dc82d7b1cbd13fda8e291935c8752
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Eirik Aavitsland 2021-04-19 09:30:18 +02:00
parent 366bdcde97
commit 259dee218e
1 changed files with 3 additions and 1 deletions

View File

@ -2663,7 +2663,9 @@ bool QDateTimePrivate::epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTi
: QDateTimePrivate::StandardTime;
}
if (add_overflow(msecs, sys.d->offsetFromUtc(msecs) * MSECS_PER_SEC, &msecs))
// NB: cast to qint64 here is important to make sure a matching
// add_overflow is found, GCC 7.5.0 fails without this cast
if (add_overflow(msecs, qint64(sys.d->offsetFromUtc(msecs) * MSECS_PER_SEC), &msecs))
return false;
msecsToTime(msecs, localDate, localTime);
return true;