As far as I understand, the intended solution is to introduce temporaries and pass those to DoNotOptimize like in https://github.com/google/benchmark/pull/1562? If so, I propose to change the examples accordingly to show users how to use DoNotOptimize properly without getting the warning.
A few examples from the User Guide trigger the warning introduced with https://github.com/google/benchmark/pull/1493 for the const-reference version of
DoNotOptimize
:As far as I understand, the intended solution is to introduce temporaries and pass those to
DoNotOptimize
like in https://github.com/google/benchmark/pull/1562? If so, I propose to change the examples accordingly to show users how to useDoNotOptimize
properly without getting the warning.