From 32692667a625f31aa02e0303f2139c780ae42694 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 17 Mar 2022 12:07:44 +0100 Subject: Apply Q_CONSTINIT across the codebase Still not complete. Just grepping for static and thread_local. Task-number: QTBUG-100486 Change-Id: I90ca14e8db3a95590ecde5f89924cf6fcc9755a3 Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/global/qlogging.cpp') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 6302fc9d80..e0dbfcf09b 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1568,7 +1568,7 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &buf); // pointer to QtMessageHandler debug handler (with context) -static QBasicAtomicPointer messageHandler = Q_BASIC_ATOMIC_INITIALIZER(nullptr); +Q_CONSTINIT static QBasicAtomicPointer messageHandler = Q_BASIC_ATOMIC_INITIALIZER(nullptr); // ------------------------ Alternate logging sinks ------------------------- @@ -1873,7 +1873,7 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con #if defined(Q_COMPILER_THREAD_LOCAL) -static thread_local bool msgHandlerGrabbed = false; +Q_CONSTINIT static thread_local bool msgHandlerGrabbed = false; static bool grabMessageHandler() { -- cgit v1.2.3