Skip to content

Commit

Permalink
tst_QVariant: suppress warning about memcpying over QVariant
Browse files Browse the repository at this point in the history
tst_qvariant.cpp:3624:15: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class QVariant’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]

Change-Id: Ic17a33f599b844d8ab5dfffd16aafcbd74823696
Reviewed-by: Edward Welbourne <[email protected]>
  • Loading branch information
thiagomacieira authored and ediosyncratic committed Oct 21, 2021
1 parent c1a5f08 commit 5bc315f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3621,7 +3621,7 @@ void tst_QVariant::movabilityTest()
QCOMPARE(buffer[0].type(), QVariant::Invalid);
buffer[0].~QVariant();

memcpy(buffer, &variant, sizeof(QVariant));
memcpy(buffer, static_cast<void *>(&variant), sizeof(QVariant));
QCOMPARE(buffer[0].type(), QVariant::UserType);
QCOMPARE(buffer[0].userType(), qMetaTypeId<MyNotMovable>());
MyNotMovable tmp(buffer[0].value<MyNotMovable>());
Expand Down

0 comments on commit 5bc315f

Please sign in to comment.