From cc6074c543a37426db9227257256c20efde40a79 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Tue, 25 Feb 2025 09:02:02 +0100 Subject: [PATCH] Add maybe_unused in benchmark to guard against nodiscard in the future Requested by Marc Mutz when adding the utc() benchmark. Pick-to: 6.8 6.5 5.15 Change-Id: I6f97f9e4dab07d10718280b4fb7ac158e42b8d67 Reviewed-by: Thiago Macieira (cherry picked from commit 1f0bcec874dba8adbdf8de34e899565e89e80a38) Reviewed-by: Qt Cherry-pick Bot --- .../benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp index 087f0adabe2..3b58b6927ae 100644 --- a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp +++ b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp @@ -70,14 +70,14 @@ void tst_QTimeZone::isTimeZoneIdAvailable() void tst_QTimeZone::systemTimeZone() { QBENCHMARK { - QTimeZone::systemTimeZone(); + [[maybe_unused]] const auto r = QTimeZone::systemTimeZone(); } } void tst_QTimeZone::utc() { QBENCHMARK { - QTimeZone::utc(); + [[maybe_unused]] const auto r = QTimeZone::utc(); } }