Skip to content

Commit 9977e16

Browse files
committed
Merge bitcoin/bitcoin#24372: bench: Avoid deprecated use of volatile +=
9999f89 bench: Avoid deprecated use of volatile += (MarcoFalke) Pull request description: Deprecated in C++20 according to https://eel.is/c++draft/expr.ass#6 . ``` bench/examples.cpp:16:13: warning: compound assignment with ‘volatile’-qualified left operand is deprecated [-Wvolatile] 16 | sum += sin(d); | ~~~~^~~~~~~~~ ``` While C++20 is currently unsupported, I don't see any downside to a minor fixup to an example benchmark. This will also make a hypothetical C++20 patch smaller. ACKs for top commit: fanquake: ACK 9999f89 Tree-SHA512: ca7d660fa8eba347a4648408a8b97a0ecb8263a825da7abd59129d783058102581e05b273667989f95480436a66d5384bd1e92d9ae79408f5b30e2178935cc38
2 parents 16d05cf + 9999f89 commit 9977e16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bench/examples.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static void Trig(benchmark::Bench& bench)
1313
{
1414
double d = 0.01;
1515
bench.run([&] {
16-
sum += sin(d);
16+
sum = sum + sin(d);
1717
d += 0.000001;
1818
});
1919
}

0 commit comments

Comments
 (0)