diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-01-03 11:27:09 -0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-01-12 19:25:42 +0000 |
commit | 70092c9a47840e1ca7606b90075b364c69876656 (patch) | |
tree | 29f115b72a141aeaed0c1d1f5fa8e92bd3350f8d /src/corelib/kernel/qobject.cpp | |
parent | 9f09fed72f87c9379fcbfd51cd6463b5c470814f (diff) |
Fix GCC 6 warning about placement-new operator on too little space
GCC 6 is able to detect when you use a placement new of an object in a
space that is too small to contain it.
qvariant_p.h: In instantiation of ‘void v_construct(QVariant::Private*, const T&) [with T = QRectF]’:
qvariant_p.h:142:9: error: placement new constructing an object of type ‘QRectF’ and size ‘32’ in a region of type ‘void*’ and size ‘8’ [-Werror=placement-new]
new (&x->data.ptr) T(t);
^~~~~~~~~~~~~~~~~~~~~~~
This happens even for the false branch of a constant expression (the
enum). So split the v_construct function in two pairs, one pair for
being able to use the internal space and one pair not so.
Change-Id: Ibc83b9f7e3bc4962ae35ffff1425ed898f279dea
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
0 files changed, 0 insertions, 0 deletions