-
Notifications
You must be signed in to change notification settings - Fork 11.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
readability-redundant-string-cstr quick-fix causes invalid code #43965
Comments
Hi Which option is correct?
|
Drive by note, maybe this should explicitly create a copy of the string |
Reopening this as a regression was introduced when fixing another bug, There is a patch in place to fix that regression https://reviews.llvm.org/D84831 |
Fixed again in b99630e, Will leave open for 11 branch merging as this regression was introduced on the 11 branch. |
Pushed as b99630e Please let me know if there are any further issues. |
reopen this for cherry-pick eed0af6 |
oops, sorry, I changed a wrong bug. |
mentioned in issue #46070 |
Extended Description
#include
static void f2(std::string&&) {
}
static void f() {
std::string const s;
f2(s.c_str()); // readability-redundant-string-cstr warning
}
Applying the quick-fix to the code above causes it to fail as an rvalue is required.
The text was updated successfully, but these errors were encountered: