From 80b6bcc385863a38d499685af9b8e857e46cbdba Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 31 Jan 2022 17:19:06 +0100 Subject: Short live Q_CONSTINIT! It expands to the first available of - constinit (C++20) - [[clang::require_constant_initialization]] (Clang) - __constinit (GCC >= 10) Use it around the code (on and near static QBasicAtomic; this patch makes no attempt to find all statics in qtbase). [ChangeLog][QtCore][QtGlobal] Added macro Q_CONSTINIT. Fixes: QTBUG-100484 Change-Id: I11e0363a7acb3464476859d12ec7f94319d82be7 Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot --- src/gui/image/qimagereader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 940f87af9a..fe0c01e54c 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -186,7 +186,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, QByteArray suffix; #ifndef QT_NO_IMAGEFORMATPLUGIN - static QBasicMutex mutex; + Q_CONSTINIT static QBasicMutex mutex; const auto locker = qt_scoped_lock(mutex); typedef QMultiMap PluginKeyMap; -- cgit v1.2.3