[PATCH] D45702: [clang-tidy] Add a new check, readability-redundant-data-call, that finds and removes redundant calls to .data().

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 16 15:39:41 PDT 2018


Eugene.Zelenko added a comment.

Please also take a look on 26817 for another idea for //.data()//.



================
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:20
+namespace readability {
+namespace {
+const char kDefaultTypes[] =
----------------
Please separate with empty line.


================
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:32
+void RedundantDataCallCheck::registerMatchers(MatchFinder *Finder) {
+  using ast_matchers::allOf;
+  using ast_matchers::anyOf;
----------------
Isn't this list redundant for //using namespace clang::ast_matchers//?


================
Comment at: docs/ReleaseNotes.rst:63
+
+  This check suggests removing redundant `.data()` calls.
+
----------------
I would suggest //Finds redundant `.data()` calls.// Same in documentation.

Please also move to new checks list in alphabetical order.


================
Comment at: docs/clang-tidy/checks/readability-redundant-data-call.rst:14
+
+The type(s) that triggers this check can be configured with `Types` option.
----------------
Please look on other check documentation for example of option descriptions.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D45702





More information about the cfe-commits mailing list