From dcc482cd01c138e4603a349986f5419b03583c96 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 6 May 2024 11:28:20 +0200 Subject: [PATCH] Disambiguate a QDateTime construction When compiling removed_api.cpp, both the removed QDateTime(QDate, QTime) constructor and the one taking a transition resolution with a default are visible. The inline fromStdLocalTime() was thus ambiguous as to which it was calling. So make the transition resolution overt. Fixes: QTBUG-125079 Change-Id: I0c498bed2831afee0adc41c4575f3ed1bc244122 Reviewed-by: Tim Blechmann Reviewed-by: Thiago Macieira (cherry picked from commit 669f7e3b9723446732d31d48b653cd2bd9580f2d) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/time/qdatetime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h index f8a9360fbb2..8bf2f9f7bfc 100644 --- a/src/corelib/time/qdatetime.h +++ b/src/corelib/time/qdatetime.h @@ -529,7 +529,7 @@ public: QT_POST_CXX17_API_IN_EXPORTED_CLASS static QDateTime fromStdLocalTime(const std::chrono::local_time &time) { - QDateTime result(QDate(1970, 1, 1), QTime(0, 0, 0)); + QDateTime result(QDate(1970, 1, 1), QTime(0, 0, 0), TransitionResolution::LegacyBehavior); return result.addMSecs(time.time_since_epoch().count()); }