summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobalstatic.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-02-24 08:58:44 -0800
committerThiago Macieira <thiago.macieira@intel.com>2022-03-09 12:37:10 -0800
commit77e4177d1634ed8e1d7eed32bdd8e9967ae6e2fe (patch)
treeea84ffa2e092b1185029028f5e7919f5e1128b21 /src/corelib/global/qglobalstatic.h
parente3cc3900cdc48051a0ca81a094c0d049c76effb0 (diff)
QGlobalStatic: fix Clang warning about expression in unevaluated context
From Clang 13: qlocale.cpp:854:161: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression] Pick-to: 6.3 Change-Id: Ibf4acec0f166495998f7fffd16d6c75ef1e04262 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/global/qglobalstatic.h')
-rw-r--r--src/corelib/global/qglobalstatic.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index 1e35cb29f0..aaa01262a7 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -134,6 +134,8 @@ protected:
};
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
+ QT_WARNING_PUSH \
+ QT_WARNING_DISABLE_CLANG("-Wunevaluated-expression") \
namespace { struct Q_QGS_ ## NAME { \
typedef TYPE QGS_Type; \
static void innerFunction(void *pointer) \
@@ -143,6 +145,7 @@ protected:
} \
}; } \
static QGlobalStatic<QtGlobalStatic::Holder<Q_QGS_ ## NAME>> NAME; \
+ QT_WARNING_POP
/**/
#define Q_GLOBAL_STATIC(TYPE, NAME, ...) \