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
parent
26cdc11503
commit
21c07f56e2
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue