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

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 29 13:58:05 PDT 2021


Eugene.Zelenko added a comment.

Thank you for implementing 26817 <https://bugs.llvm.org/show_bug.cgi?id=26817>! But shouldn't this check belong to `modernize` module?

Please add documentation and mention new check in Release Notes.



================
Comment at: clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.cpp:18
+namespace tidy {
+namespace readability {
+ContainerDataPointerCheck::ContainerDataPointerCheck(StringRef Name,
----------------
Please separate with empty line.


================
Comment at: clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.cpp:117
+      << Hint;
+}
+} // namespace readability
----------------
Please separate with empty line.


================
Comment at: clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.h:17
+namespace readability {
+/// Checks whether a call to `operator[]` and `&` can be replaced with a call to
+/// `data()`.
----------------
Please separate with empty line.


================
Comment at: clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.h:40
+  }
+};
+} // namespace readability
----------------
Please separate with empty line.


================
Comment at: clang-tools-extra/clang-tidy/readability/ContainerDataPointerCheck.h:45
+
+#endif
----------------
Please add inclusion guard in comment.


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