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

Alexander Kornienko alexfh at google.com
Tue Mar 10 11:02:12 PDT 2015


================
Comment at: clang-tidy/readability/RedundantVoidArgCheck.cpp:14
@@ +13,3 @@
+
+using namespace clang;
+using namespace clang::ast_matchers;
----------------
nit: Remove this and just start `namespace clang {` (or all three of them) here instead of line 50 below. Then clang::ast_matchers can be replaced with ast_matchers as well. 

================
Comment at: clang-tidy/readability/RedundantVoidArgCheck.cpp:146
@@ +145,3 @@
+                           Result.Context->getLangOpts()).str();
+  clang::Lexer PrototypeLexer(Range.getBegin(), Result.Context->getLangOpts(),
+                              DeclText.data(), DeclText.data(),
----------------
nit: No need for clang:: here.

================
Comment at: clang-tidy/readability/RedundantVoidArgCheck.cpp:195
@@ +194,3 @@
+  SourceLocation VoidLoc(VoidToken.getLocation());
+  auto VoidRange = SourceRange(VoidLoc, VoidLoc.getLocWithOffset(3));
+  diag(VoidLoc, Diagnostic) << FixItHint::CreateRemoval(VoidRange);
----------------
It's better to use token ranges here:

  CharSourceRange::getTokenRange(VoidLoc, VoidLoc)

================
Comment at: test/clang-tidy/readability-redundant-void-arg.cpp:86
@@ +85,3 @@
+
+class gronk
+{
----------------
Please use LLVM style in tests unless needed otherwise for testing whitespace handling: 2 character indentation, left brace on the previous line, etc.

http://reviews.llvm.org/D7639

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






More information about the cfe-commits mailing list