diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2012-01-03 17:05:49 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-04 00:32:44 +0100 |
commit | e3e234b5eb9e9d65894e2f7c58c15b1d19c9414f (patch) | |
tree | c3b22da0c3f4042c30706a6a79103b12aa7afa0a /src | |
parent | 7a597e6c43295c629f389203059d51f869ec02e0 (diff) |
Fixed static assert in qvariant template magic
CallConstructor<T, /* CanUseInternalSpace = */ false> is called when we need to
construct an object that couldn't be fit in qvariantdata, meaning either it is
not a POD type (Q_PRIMITIVE_TYPE), or it is simply too large to fit there.
Change-Id: Ied122b4a6f600e14312a8d515f5b3e91214a94f1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qvariant_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index f7f1399312..a90164fa71 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -327,7 +327,7 @@ class QVariantConstructor { CallConstructor(const QVariantConstructor &tc) { - Q_STATIC_ASSERT(QTypeInfo<T>::isComplex); + Q_STATIC_ASSERT(QTypeInfo<T>::isComplex || sizeof(T) > sizeof(QVariant::Private::Data)); tc.m_x->data.shared = tc.m_copy ? new QVariantPrivateSharedEx<T>(*static_cast<const T*>(tc.m_copy)) : new QVariantPrivateSharedEx<T>; tc.m_x->is_shared = true; |