diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2012-11-07 11:23:09 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-11 12:10:49 +0100 |
commit | 21c07f56e27b6761d94fbb5105329e2393539f2a (patch) | |
tree | 5dec8cc34331c2ca145ef6778af13d00f34cd220 /tests | |
parent | 26cdc115036c6673bfe8bb3e7b47af82a43c955e (diff) |
Fix a warning on compilers not supporting constexpr.
Macros should call QSKIP instead of creating a semi-empty function body.
Change-Id: I389701f618fe9bf0a40aa26f161620389a80e407
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 8 |
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 |