summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index c8a1eb1797..266eb48ca7 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1741,25 +1741,25 @@ struct RegisterMetaTypeStructDefaultTemplateValue
void tst_QMetaType::constexprMetaTypeIds()
{
+#if defined(Q_COMPILER_CONSTEXPR)
int id = 0;
int metaType;
switch(id) {
-#if defined(Q_COMPILER_CONSTEXPR)
QT_FOR_EACH_STATIC_TYPE(METATYPE_ID_FUNCTION)
metaType = MetaTypeIdStructDefaultTemplateValue<>::Value;
-#endif
default:;
}
switch (id) {
-#if defined(Q_COMPILER_CONSTEXPR)
QT_FOR_EACH_STATIC_TYPE(REGISTER_METATYPE_FUNCTION)
metaType = RegisterMetaTypeStructDefaultTemplateValue<>::Value;
-#endif
default:;
}
Q_UNUSED(metaType);
+#else
+ QSKIP("The test needs a compiler supporting constexpr");
+#endif
}
// Compile-time test, it should be possible to register function pointer types