[PATCH] Add readability-remove-void-arg check to clang-tidy

Alexander Kornienko alexfh at google.com
Wed Feb 25 07:08:58 PST 2015


================
Comment at: clang-tidy/readability/RemoveVoidArg.cpp:105
@@ +104,3 @@
+  const BoundNodes &Nodes = Result.Nodes;
+  if (const auto Function = Nodes.getNodeAs<FunctionDecl>(FunctionId)) {
+    processFunctionDecl(Result, Function);
----------------
I think, the "const" here makes the code less readable and doesn't add any value as the variable is only visible to a one-line statement. Same for the other conditions.

================
Comment at: clang-tidy/readability/RemoveVoidArg.cpp:207
@@ +206,3 @@
+void RemoveVoidArg::processFieldDecl(const MatchFinder::MatchResult &Result,
+                                     const FieldDecl *const Member) {
+  const std::string Text = getText(Result, *Member);
----------------
Please remove top-level const in the method definitions as well.

http://reviews.llvm.org/D7639

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list