[PATCH] D108893: clang-tidy: introduce readability-containter-data-pointer check

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 14 08:21:29 PDT 2021


aaron.ballman added a comment.

In D108893#2999763 <https://reviews.llvm.org/D108893#2999763>, @compnerd wrote:

> @Eugene.Zelenko - sorry, I didn't see the additional comments before the commit.  I'm happy to do a follow up depending on the resolution.

If there's a follow-up to add this to modernize, I would say that version of the check should transition `&v[N]` to `v.data() + N` (perhaps optionally). I don't think a follow-up to add this to bugprone makes a lot of sense because of the high potential for false positive diagnostics (I think the bugprone one should be a static analyzer check that looks for a preceding predicate that checks the size of the container or whether it's empty).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108893/new/

https://reviews.llvm.org/D108893



More information about the cfe-commits mailing list