[PATCH] D26279: [clang-tidy] Handle data() in readability-redundant-string-cstr

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 05:38:14 PDT 2016

aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.


I like the idea, but would point out that `data()` and `c_str()` had different semantics once upon a time. In c++03 and earlier, `data()` was not guaranteed to be null terminated, but`c_str()` was. However, I'm not certain that's worth altering the behavior of this check for; I don't think any implementation actually made that distinction in practice.


More information about the cfe-commits mailing list