QMetaType: fix an is_pod test that C++11 broke

C++11 allows non-POD-types in unions, so the test didn't test anything.
Use a static_assert over std::is_pod instead.

Change-Id: Ida7ef0551ae6ae07357a987a409294d2a386be2f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
Marc Mutz 2019-06-07 23:00:53 +02:00
parent ff88c3bc55
commit fafae936a6

View File

@ -587,13 +587,7 @@ QMetaTypeComparatorRegistry;
typedef QMetaTypeFunctionRegistry<QtPrivate::AbstractDebugStreamFunction,int>
QMetaTypeDebugStreamRegistry;
namespace
{
union CheckThatItIsPod
{ // This should break if QMetaTypeInterface is not a POD type
QMetaTypeInterface iface;
};
}
Q_STATIC_ASSERT(std::is_pod<QMetaTypeInterface>::value);
Q_DECLARE_TYPEINFO(QCustomTypeInfo, Q_MOVABLE_TYPE);
Q_GLOBAL_STATIC(QVector<QCustomTypeInfo>, customTypes)