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>
This commit is contained in:
Denis Dzyubenko 2012-01-03 17:05:49 +01:00 committed by Qt by Nokia
parent 7a597e6c43
commit e3e234b5eb

View File

@ -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;