From d62d51c7e622eb78541816b54748ef5ade2061ea Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Tue, 27 Feb 2018 12:56:39 +0200 Subject: Silence a GCC 8 warning in qringbuffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtbase/src/corelib/tools/qvector.h:782:16: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class QRingChunk’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] memmove(b + 1, b, (d->size - offset) * sizeof(T)); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../../../include/QtCore/5.11.0/QtCore/private/qringbuffer_p.h:1, Change-Id: I6583241223fe3fc76c0b792779993a34aa9485fe Reviewed-by: Friedemann Kleint Reviewed-by: Alex Trotsenko Reviewed-by: Simon Hausmann Reviewed-by: Thiago Macieira --- src/corelib/tools/qvector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 9a6e67cc0b..a01d5c8f3c 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -779,7 +779,7 @@ typename QVector::iterator QVector::insert(iterator before, T &&t) } } else { T *b = d->begin() + offset; - memmove(b + 1, b, (d->size - offset) * sizeof(T)); + memmove(static_cast(b + 1), static_cast(b), (d->size - offset) * sizeof(T)); new (b) T(std::move(t)); } d->size += 1; -- cgit v1.2.3