tst_QUniqueHandle: silence GCC/Clang -Wself-move warnings

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.8
Change-Id: Ibdf982a728f2c6150f2911173dc3c9246f3662b8
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f0f39673f5ae9debd9ab59be60c32f00f40c41a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ahmad Samir 2025-01-13 15:36:48 +02:00 committed by Qt Cherry-pick Bot
parent 4d34eee362
commit 55f8c072a3

View File

@ -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()));