From 6f0f39673f5ae9debd9ab59be60c32f00f40c41a Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 13 Jan 2025 15:36:48 +0200 Subject: [PATCH] tst_QUniqueHandle: silence GCC/Clang -Wself-move warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And remove NOLINT(clang-diagnostic-self-move), silencing the warning for Clang seems to work for clang-tidy too (tested locally). Amends 03bd9491491881529ad28cd6d672edfdda9a0065. Pick-to: 6.9 6.8 Change-Id: Ibdf982a728f2c6150f2911173dc3c9246f3662b8 Reviewed-by: Jøger Hansegård Reviewed-by: Thiago Macieira --- .../auto/corelib/tools/quniquehandle/tst_quniquehandle.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/tools/quniquehandle/tst_quniquehandle.cpp b/tests/auto/corelib/tools/quniquehandle/tst_quniquehandle.cpp index a23b2132d66..1bf99712a5d 100644 --- a/tests/auto/corelib/tools/quniquehandle/tst_quniquehandle.cpp +++ b/tests/auto/corelib/tools/quniquehandle/tst_quniquehandle.cpp @@ -149,7 +149,12 @@ private slots: void moveAssignment_maintainsOwnershipWhenSelfAssigning() const { Handle resource{ GlobalResource::open() }; - resource = std::move(resource); // NOLINT(clang-diagnostic-self-move) + +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wself-move") +QT_WARNING_DISABLE_CLANG("-Wself-move") + resource = std::move(resource); +QT_WARNING_POP QVERIFY(resource.isValid()); QVERIFY(GlobalResource::isOpen(resource.get()));