diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-06-07 23:00:53 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-06-12 08:16:24 +0000 |
commit | fafae936a68bac1231b2de69b58e8248ae5dca2f (patch) | |
tree | a2ec4c58504d8f934926f24b7ad346e35872ef9a /src | |
parent | ff88c3bc55acefb3e57c01162d2dc04c5e24a276 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 311fb01fd0..754f5a13e4 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -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) |