Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

readability-redundant-string-cstr doesn't catch c_str() calls in polymorphic functions/methods #24869

Open Quuxplusone opened 9 years ago

Quuxplusone commented 9 years ago
Bugzilla Link PR24870
Status NEW
Importance P normal
Reported by Eugene Zelenko (eugene.zelenko@gmail.com)
Reported on 2015-09-17 20:35:16 -0700
Last modified on 2016-04-22 05:24:44 -0700
Version unspecified
Hardware All All
CC alexfh@google.com, djasper@google.com, kbobyrev.opensource@gmail.com, klimek@google.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
readability-redundant-string-cstr doesn't catch c_str() calls in polymorphic
functions/methods.

For example:

std::ofstream outfile;
string filename;

...

outfile.open( filename.c_str() );
Quuxplusone commented 9 years ago

Same for operators like:

std::string S1, S2;

S1 = S2.c_str();

or

S1 += S2.c_str();

Quuxplusone commented 8 years ago

Partially implemented in r266463.

Quuxplusone commented 8 years ago

Second case is caught by latest clang-tidy version.

The first one, hovewever, is still not.