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

Richard legalize at xmission.com
Sat May 16 17:02:09 PDT 2015


================
Comment at: clang-tidy/readability/RedundantVoidArgCheck.cpp:14
@@ +13,3 @@
+
+using namespace clang;
+using namespace clang::ast_matchers;
----------------
alexfh wrote:
> 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. 
Fixed.

================
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(),
----------------
alexfh wrote:
> nit: No need for clang:: here.
Fixed.

================
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);
----------------
alexfh wrote:
> It's better to use token ranges here:
> 
>   CharSourceRange::getTokenRange(VoidLoc, VoidLoc)
Fixed.

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

http://reviews.llvm.org/D7639

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






More information about the cfe-commits mailing list