diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-01-29 22:00:46 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-02-04 08:34:03 +0000 |
commit | 403343039d07812c0beee9260b291f86e14d8ac4 (patch) | |
tree | 6f0652206e5c8842ca0f8067c8a3ff94adcd6db8 | |
parent | c26c5b7d0dc4607b7cdd5569c5180b94b4563b73 (diff) | |
download | qtbase-403343039d07812c0beee9260b291f86e14d8ac4.tar.gz |
Suppress GCC 8 warning about realloc() non-trivially-copyable types
But they are movable.
qxmlstream_p.h:654:32: error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘struct QXmlStreamPrivateTagStack::Tag’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess]
Change-Id: I41d006aac5bc48529845fffd150e8115eb852034
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/xml/qxmlstream_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index 9ef95c1fbe..e6c89e40cd 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -651,7 +651,8 @@ public: inline void reserve(int extraCapacity) { if (tos + extraCapacity + 1 > cap) { cap = qMax(tos + extraCapacity + 1, cap << 1 ); - data = reinterpret_cast<T *>(realloc(data, cap * sizeof(T))); + void *ptr = realloc(static_cast<void *>(data), cap * sizeof(T)); + data = reinterpret_cast<T *>(ptr); Q_CHECK_PTR(data); } } |