-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] DoNotOptimize const &
overload chosen for non-const lvalue references
#1619
Comments
If this is confirmed to be a bug, I could offer to provide a PR with the code changes and test cases. |
I'm pretty sure #1608 should have only affected rvalues, so this does seem like a bug. |
|
Ok, no, let me backtrack, those are false-positives, this is a bug. @eseiler patches most welcomed! |
Describe the bug
After df9a99d,
const &
overloads are chosen where previously the&
overload was chosen. This leads to deprecation warnings where IMO there should be none.const &
takes precedence over the new&&
overload.Godbolt: https://godbolt.org/z/5s6sKT7dc
Click to show code from godbolt example
System
Which OS, compiler, and compiler version are you using:
To reproduce
See bug description.
Expected behavior
IMO, it should still work. There probably needs to be both
&
and&&
overloads. It does work if I add additional&
overloads.The text was updated successfully, but these errors were encountered: