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>
This commit is contained in:
parent
c26c5b7d0d
commit
403343039d
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user