Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Examples from User Guide trigger deprecation warning for const-reference DoNotOptimize #1566

Closed
mjacobse opened this issue Mar 7, 2023 · 0 comments · Fixed by #1568
Labels
docs documentation update needed good first issue help wanted

Comments

@mjacobse
Copy link
Contributor

mjacobse commented Mar 7, 2023

A few examples from the User Guide trigger the warning introduced with #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 #1562? If so, I propose to change the examples accordingly to show users how to use DoNotOptimize properly without getting the warning.

@dmah42 dmah42 added good first issue help wanted docs documentation update needed labels Mar 7, 2023
mjacobse added a commit to mjacobse/benchmark that referenced this issue Mar 7, 2023
The const-reference API to DoNotOptimize was deprecated with google#1493. Some
examples in the user guide are using exactly that deprecated interface.
This fixes that by passing non-const lvalues instead. Fixes google#1566
dmah42 pushed a commit that referenced this issue Mar 7, 2023
* Update AUTHORS/CONTRIBUTORS

* Fix examples with deprecated DoNotOptimize API

The const-reference API to DoNotOptimize was deprecated with #1493. Some
examples in the user guide are using exactly that deprecated interface.
This fixes that by passing non-const lvalues instead. Fixes #1566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs documentation update needed good first issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants