diff options
author | fanquake <fanquake@gmail.com> | 2022-02-23 11:20:13 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2022-02-23 11:29:39 +0000 |
commit | 9977e1658c82efc705feb7ab001c371733077bcb (patch) | |
tree | e02a5e4c902a47008d242a27a2dc36d3b571882c | |
parent | 16d05cf6b9187fc47bab446a533ea140fe32b8e2 (diff) | |
parent | 9999f891d1c9093e552492cf8ccc3168370c7a39 (diff) |
Merge bitcoin/bitcoin#24372: bench: Avoid deprecated use of volatile +=
9999f891d1c9093e552492cf8ccc3168370c7a39 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 9999f891d1c9093e552492cf8ccc3168370c7a39
Tree-SHA512: ca7d660fa8eba347a4648408a8b97a0ecb8263a825da7abd59129d783058102581e05b273667989f95480436a66d5384bd1e92d9ae79408f5b30e2178935cc38
-rw-r--r-- | src/bench/examples.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bench/examples.cpp b/src/bench/examples.cpp index dcd615b9da..72a9922e94 100644 --- a/src/bench/examples.cpp +++ b/src/bench/examples.cpp @@ -13,7 +13,7 @@ static void Trig(benchmark::Bench& bench) { double d = 0.01; bench.run([&] { - sum += sin(d); + sum = sum + sin(d); d += 0.000001; }); } |