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>
bb10
Jędrzej Nowacki 2012-11-07 11:23:09 +01:00 committed by The Qt Project
parent 26cdc11503
commit 21c07f56e2
1 changed files with 4 additions and 4 deletions

View File

@ -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