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 <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Marc Mutz 2022-02-04 16:41:48 +01:00
parent 38d2f60f9a
commit e65a14f82f

View File

@ -1245,7 +1245,7 @@ QList<QByteArray> 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)