From 0ed1f8b54e42fc731eae302cdd1b06e955f01be9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 30 Jun 2021 10:57:17 +0200 Subject: [PATCH] tests: fix deprecated implicit capture of this via [=] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes compiler warnings: warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated] Change-Id: Ia7cf50f491e92f39162c69afb2a8320afedba056 Reviewed-by: Giuseppe D'Angelo --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 2 +- tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp | 2 +- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 674eb3f472d..f5fb92b32ba 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -293,7 +293,7 @@ public: #if !defined(Q_OS_MACOS) // FIXME: All platforms should send window-state change events, regardless // of the sync/async nature of the the underlying platform, but they don't. - connect(this, &QWindow::windowStateChanged, [=]() { + connect(this, &QWindow::windowStateChanged, [this]() { lastReceivedWindowState = windowState(); }); #endif diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp index 5118584b5ee..d907ea34aac 100644 --- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp @@ -363,7 +363,7 @@ void tst_QHostInfo::lookupConnectToLambda() QFETCH(QString, addresses); lookupDone = false; - QHostInfo::lookupHost(hostname, [=](const QHostInfo &hostInfo) { + QHostInfo::lookupHost(hostname, [this](const QHostInfo &hostInfo) { resultsReady(hostInfo); }); diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 1239e70ee35..456fe8d7150 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -193,7 +193,7 @@ QNetworkInterface tst_QUdpSocket::interfaceForGroup(const QHostAddress &multicas if (!scope.isEmpty()) return QNetworkInterface::interfaceFromName(scope); - static QNetworkInterface ipv6if = [=]() { + static QNetworkInterface ipv6if = [&]() { // find any link local address in the allAddress list for (const QHostAddress &addr: qAsConst(allAddresses)) { if (addr.isLoopback())