@@ -124,12 +124,12 @@ inline void test_no_data_race()
124124 // Then only read from the vector - no data race
125125 std::vector<std::thread> threads;
126126
127- for (auto _ : std::ranges::iota_view (0 , 3 ))
127+ for ([[maybe_unused]] auto _ : std::ranges::iota_view (0 , 3 ))
128128 threads.emplace_back ([&]
129129 {
130- for (auto _ : std::ranges::iota_view (0uz, 1'000' 000uz))
130+ for ([[maybe_unused]] auto _ : std::ranges::iota_view (0uz, 1'000' 000uz))
131131 {
132- volatile auto c = 0uz;
132+ [[maybe_unused]] volatile auto c = 0uz;
133133
134134 if (! vec.empty ())
135135 c = vec[vec.size () - 1 ];
@@ -156,12 +156,12 @@ inline void test_data_race()
156156 }
157157 });
158158
159- for (auto _ : std::ranges::iota_view (0 , 3 ))
159+ for ([[maybe_unused]] auto _ : std::ranges::iota_view (0 , 3 ))
160160 threads.emplace_back ([&]
161161 {
162162 for (;;)
163163 {
164- volatile auto c = 0uz;
164+ [[maybe_unused]] volatile auto c = 0uz;
165165
166166 if (! vec.empty ())
167167 c = vec[vec.size () - 1 ];
@@ -183,12 +183,12 @@ inline void test_no_data_race_read_read()
183183 // Then only read from the vector - no data race
184184 std::vector<std::thread> threads;
185185
186- for (auto _ : std::ranges::iota_view (0 , 3 ))
186+ for ([[maybe_unused]] auto _ : std::ranges::iota_view (0 , 3 ))
187187 threads.emplace_back ([&]
188188 {
189- for (auto _ : std::ranges::iota_view (0uz, 1'000' 000uz))
189+ for ([[maybe_unused]] auto _ : std::ranges::iota_view (0uz, 1'000' 000uz))
190190 {
191- volatile auto c = 0uz;
191+ [[maybe_unused]] volatile auto c = 0uz;
192192
193193 if (! vec.empty ())
194194 c = vec[vec.size () - 1 ];
0 commit comments