From e3e234b5eb9e9d65894e2f7c58c15b1d19c9414f Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 3 Jan 2012 17:05:49 +0100 Subject: [PATCH] Fixed static assert in qvariant template magic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CallConstructor 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 --- src/corelib/kernel/qvariant_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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::isComplex); + Q_STATIC_ASSERT(QTypeInfo::isComplex || sizeof(T) > sizeof(QVariant::Private::Data)); tc.m_x->data.shared = tc.m_copy ? new QVariantPrivateSharedEx(*static_cast(tc.m_copy)) : new QVariantPrivateSharedEx; tc.m_x->is_shared = true;