From c00e443dcc5024aa1239ed2f494da13ab572d238 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 22 Jan 2022 21:34:46 +0100 Subject: tst_bench_qlocalsocket: fix Clang 10 warnings about unneeded capture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The timeToTest constant doesn't need to be captured, claims Clang. Since I don't recall seeing this warning on GCC, be pragmatic and fix by letting the compiler choose what to capture: [&]. timeToTest is const, so it doesn't matter whether we capture by reference or value, the lambda cannot change it either way. This code doesn't seem to exist in 5.15, so merely Pick-to: 6.3 6.2 Change-Id: I48d42ab13ed22ac5eb512dc61235b72a19636ea3 Reviewed-by: Fabian Kosmale Reviewed-by: MÃ¥rten Nordheim --- tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 7130895f51..c04a0228f9 100644 --- a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -212,8 +212,7 @@ void tst_QLocalSocket::dataExchange() qint64 totalReceived = 0; QElapsedTimer timer; - connect(&factory, &SocketFactory::bytesReceived, - [&totalReceived, &timer, timeToTest, &factory, &eventLoop](int channel, qint64 bytes) { + connect(&factory, &SocketFactory::bytesReceived, [&](int channel, qint64 bytes) { Q_UNUSED(channel); totalReceived += bytes; -- cgit v1.2.3