From 62edc4fb00e1aeab86cc69c70eafffb17219d047 Mon Sep 17 00:00:00 2001 From: Yury Fedorov <114264320+yuryf-google@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:03:11 +0100 Subject: [PATCH] Bug fix variable 'actual_iterations' set but not used (#1517) * Bug fix variable 'actual_iterations' set but not used Compiling the project in clang 15 without -Wno-unused-but-set-variable flag the following error is generated: benchmark-src/test/options_test.cc:70:10: error: variable 'actual_iterations' set but not used [-Werror,-Wunused-but-set-variable] size_t actual_iterations = 0; ^ * Adjust according formatting of `clang-format` Co-authored-by: dominic hamon <510002+dmah42@users.noreply.github.com> --- test/options_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/options_test.cc b/test/options_test.cc index 6bba0ea8..a1b209f3 100644 --- a/test/options_test.cc +++ b/test/options_test.cc @@ -67,8 +67,8 @@ void BM_explicit_iteration_count(benchmark::State& state) { // Test that the requested iteration count is respected. assert(state.max_iterations == 42); - size_t actual_iterations = 0; - for (auto _ : state) ++actual_iterations; + for (auto _ : state) { + } assert(state.iterations() == state.max_iterations); assert(state.iterations() == 42); }