[clang-tools-extra] [clang-tidy] Improve `container-data-pointer` check to use `c_str()` (PR #71304)

Eli Black via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 5 08:19:57 PST 2023


neoncube2 wrote:

@PiotrZSL Thanks for the quick review! :)

I think #54076 covers the `const` issue. Since `container-data-pointer` is already broken for code such as `char *t = str.data();`, I think merging this PR wouldn't cause additional issues, but I could be wrong about that! :)

I'd like to take a look at #54076 next, but I think that'd be a bit more complicated to fix, since it involves the left-hand side of the expression (Unless there's already a helper method to determine whether the left-hand side of the expression is `const`?)

Thanks again for the review! :)

https://github.com/llvm/llvm-project/pull/71304


More information about the cfe-commits mailing list