From e65a14f82f893448970dfa56e889ca90ff2043c3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 4 Feb 2022 16:41:48 +0100 Subject: [PATCH] QTzTimeZonePrivate: make ZoneNameReader constinit'able It's used as a thread_local static, so it better be. What prevented it was the unused inheritance from QObject and the missing constexpr ctor of the StatIdent() data member. Fixed both. Pick-to: 6.3 Change-Id: I312ed6dc8bf7193cdaa7dc708bf19b018e56ec8a Reviewed-by: Thiago Macieira Reviewed-by: Edward Welbourne --- src/corelib/time/qtimezoneprivate_tz.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp index 8dfd88b281..0c59fa2d09 100644 --- a/src/corelib/time/qtimezoneprivate_tz.cpp +++ b/src/corelib/time/qtimezoneprivate_tz.cpp @@ -1245,7 +1245,7 @@ QList QTzTimeZonePrivate::availableTimeZoneIds(QLocale::Territory te // Getting the system zone's ID: namespace { -class ZoneNameReader : public QObject +class ZoneNameReader { public: QByteArray name() @@ -1298,7 +1298,7 @@ private: { static constexpr unsigned long bad = ~0ul; unsigned long m_dev, m_ino; - StatIdent() : m_dev(bad), m_ino(bad) {} + constexpr StatIdent() : m_dev(bad), m_ino(bad) {} StatIdent(const QT_STATBUF &data) : m_dev(data.st_dev), m_ino(data.st_ino) {} bool isValid() { return m_dev != bad || m_ino != bad; } bool operator==(const StatIdent &other)