[PATCH] [clang-tidy] Add a checker that flags unnamed parameters.

Daniel Jasper djasper at google.com
Tue Jul 15 06:16:48 PDT 2014


================
Comment at: clang-tidy/google/NamedParameterCheck.cpp:63
@@ +62,3 @@
+    for (SourceLocation Loc : UnnamedParamLocations)
+      D << FixItHint::CreateInsertion(Loc, " /*unused*/");
+  }
----------------
IMO, most functions with unnamed parameters will be derived from some base method. Otherwise, why would they have an unnamed parameter (yes, there are cases, but not that many)?

To this end:
- Add tests for methods overriding methods with named parameters.
- I think the common pattern for the unnamed parameter comment is /*<parameter name>*/ Could we extract the parameter name from the overridden function.

http://reviews.llvm.org/D4518






More information about the cfe-commits mailing list