QSystemSemaphore: fix -Werror=deprecated in C++20 build

Capture of *this by reference in [=] is deprecated in C++20. Use the
perfectly adequate [&] instead.

Amends 32a06e9830.

Change-Id: I6f8a127f3a777099f9c93d932ee3105e852c4fd5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2023-01-24 12:46:53 +01:00
parent 66767eea46
commit ef1059b141

View File

@ -132,15 +132,15 @@ public:
void handle(QSystemSemaphore::AccessMode mode)
{
visit([=](auto p) { p->handle(this, mode); });
visit([&](auto p) { p->handle(this, mode); });
}
void cleanHandle()
{
visit([=](auto p) { p->cleanHandle(this); });
visit([&](auto p) { p->cleanHandle(this); });
}
bool modifySemaphore(int count)
{
return visit([=](auto p) { return p->modifySemaphore(this, count); });
return visit([&](auto p) { return p->modifySemaphore(this, count); });
}
QString legacyKey; // deprecated