From 6f1821dfa302c028f7899e4485dfaf24a6a02457 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 22 Jan 2022 21:13:28 +0100 Subject: benchmarks: fix some (future) -Wunused-result warnings Clang 10 warns about unused results of relational operators, which is where this is coming from. Fix by adding the usual prefix [[maybe_unused]] auto r = ~~~; to silence the warning. Do this elsewhere, too, since [[nodiscard]] is slowly being rolled out across all our APIs. This is not a complete sweep, though. Not picking to 5.15, because this pattern doesn't work there and I don't want to introduce a new one. Pick-to: 6.3 6.2 Change-Id: I40dd8ad07496b686979dce533e044cbb486e30f3 Reviewed-by: Fabian Kosmale --- tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/benchmarks/corelib/plugin/quuid') diff --git a/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp b/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp index 2db1563568..4088ea320a 100644 --- a/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp +++ b/tests/benchmarks/corelib/plugin/quuid/tst_bench_quuid.cpp @@ -55,7 +55,7 @@ private slots: void tst_QUuid::createUuid() { QBENCHMARK { - QUuid::createUuid(); + [[maybe_unused]] auto r = QUuid::createUuid(); } } @@ -70,7 +70,7 @@ void tst_QUuid::toString() { QUuid uuid = QUuid::createUuid(); QBENCHMARK { - uuid.toString(); + [[maybe_unused]] auto r = uuid.toString(); } } @@ -86,7 +86,7 @@ void tst_QUuid::toByteArray() { QUuid uuid = QUuid::createUuid(); QBENCHMARK { - uuid.toByteArray(); + [[maybe_unused]] auto r = uuid.toByteArray(); } } @@ -102,7 +102,7 @@ void tst_QUuid::toRfc4122() { QUuid uuid = QUuid::createUuid(); QBENCHMARK { - uuid.toRfc4122(); + [[maybe_unused]] auto r = uuid.toRfc4122(); } } @@ -168,7 +168,7 @@ void tst_QUuid::isNull() { QUuid uuid = QUuid(); QBENCHMARK { - uuid.isNull(); + [[maybe_unused]] auto r = uuid.isNull(); } } @@ -178,7 +178,7 @@ void tst_QUuid::operatorLess() uuid1 = QUuid::createUuid(); uuid2 = QUuid::createUuid(); QBENCHMARK { - uuid1 < uuid2; + [[maybe_unused]] auto r = uuid1 < uuid2; } } @@ -188,7 +188,7 @@ void tst_QUuid::operatorMore() uuid1 = QUuid::createUuid(); uuid2 = QUuid::createUuid(); QBENCHMARK { - uuid1 > uuid2; + [[maybe_unused]] auto r = uuid1 > uuid2; } } -- cgit v1.2.3