Fix QtPrivate::IsQEnumHelper<void>
Change-Id: I1633ef128212a6b99b66129f13e0b4d5ea46644d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
298a60d958
commit
35a125971c
@ -1381,6 +1381,7 @@ QT_WARNING_DISABLE_CLANG("-Wlocal-type-template-args")
|
||||
// qt_getEnumMetaObject(T) which returns 'char'
|
||||
enum { Value = sizeof(qt_getEnumMetaObject(declval())) == sizeof(QMetaObject*) };
|
||||
};
|
||||
template<> struct IsQEnumHelper<void> { enum { Value = false }; };
|
||||
QT_WARNING_POP
|
||||
|
||||
template<typename T, typename Enable = void>
|
||||
|
@ -91,5 +91,13 @@ void tst_QMetaEnum::valuesToKeys()
|
||||
QCOMPARE(me.valueToKeys(windowFlags), expected);
|
||||
}
|
||||
|
||||
Q_STATIC_ASSERT(QtPrivate::IsQEnumHelper<tst_QMetaEnum::SuperEnum>::Value);
|
||||
Q_STATIC_ASSERT(QtPrivate::IsQEnumHelper<Qt::WindowFlags>::Value);
|
||||
Q_STATIC_ASSERT(QtPrivate::IsQEnumHelper<Qt::Orientation>::Value);
|
||||
Q_STATIC_ASSERT(!QtPrivate::IsQEnumHelper<int>::Value);
|
||||
Q_STATIC_ASSERT(!QtPrivate::IsQEnumHelper<QObject>::Value);
|
||||
Q_STATIC_ASSERT(!QtPrivate::IsQEnumHelper<QObject*>::Value);
|
||||
Q_STATIC_ASSERT(!QtPrivate::IsQEnumHelper<void>::Value);
|
||||
|
||||
QTEST_MAIN(tst_QMetaEnum)
|
||||
#include "tst_qmetaenum.moc"
|
||||
|
Loading…
Reference in New Issue
Block a user