From 6f17509ad9044c689e22719c6c4d1f7f88e4c954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 26 Jul 2020 19:44:12 +0200 Subject: [PATCH] Fix warnings about unused members in tests Change-Id: I741cf08c26f8a2e297926cc01968ff09e70462a2 Reviewed-by: Volker Hilsheimer --- tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 6 +++--- tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | 2 +- tests/auto/corelib/tools/qpair/tst_qpair.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 3d729eae67..f55d115f8f 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -986,9 +986,9 @@ public: }; Q_DECLARE_METATYPE(CustomMultiInheritanceObject*); -class C { char _[4]; public: C() = default; C(const C&) {} }; -class M { char _[4]; public: M() {} }; -class P { char _[4]; }; +class C { Q_DECL_UNUSED_MEMBER char _[4]; public: C() = default; C(const C&) {} }; +class M { Q_DECL_UNUSED_MEMBER char _[4]; public: M() {} }; +class P { Q_DECL_UNUSED_MEMBER char _[4]; }; QT_BEGIN_NAMESPACE #if defined(Q_CC_GNU) && Q_CC_GNU < 501 diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 6e32ba8039..8b78b34992 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -535,7 +535,7 @@ void tst_QArrayData::reallocate() class Unaligned { - char dummy[8]; + Q_DECL_UNUSED_MEMBER char dummy[8]; }; void tst_QArrayData::alignment_data() diff --git a/tests/auto/corelib/tools/qpair/tst_qpair.cpp b/tests/auto/corelib/tools/qpair/tst_qpair.cpp index 0708c15530..464477d5d1 100644 --- a/tests/auto/corelib/tools/qpair/tst_qpair.cpp +++ b/tests/auto/corelib/tools/qpair/tst_qpair.cpp @@ -43,9 +43,9 @@ private Q_SLOTS: void testDeductionRules(); }; -class C { C() {} char _[4]; }; -class M { M() {} char _[4]; }; -class P { char _[4]; }; +class C { C() {} Q_DECL_UNUSED_MEMBER char _[4]; }; +class M { M() {} Q_DECL_UNUSED_MEMBER char _[4]; }; +class P { Q_DECL_UNUSED_MEMBER char _[4]; }; QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(M, Q_MOVABLE_TYPE);