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.9 6.8
Change-Id: Ibdf982a728f2c6150f2911173dc3c9246f3662b8
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ahmad Samir 2025-01-13 15:36:48 +02:00
parent 55a4c6e9fc
commit 6f0f39673f

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