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

Benjamin Kramer benny.kra at gmail.com
Tue Jul 15 09:01:05 PDT 2014


On Tue, Jul 15, 2014 at 5:47 PM, David Blaikie <dblaikie at gmail.com> wrote:
> On Tue, Jul 15, 2014 at 6:57 AM, Benjamin Kramer <benny.kra at gmail.com> wrote:
>> - Added a testcase with multiple template instantiations.
>> - If a method has an unnamed argument and is overriding a method from a base cla
>> ss try to copy the argument name from the base class first.
>
> Something similar for decl/defs?
>
>   void func(int x);
>   ...
>   void func(int) {
>   }
>
> Not sure if that comes up all that often, though?

Definitely useful. Dealing with the possible conflicts when you have
multiple redeclarations is a nice follow up and we also want to verify
that there all of them use the same parameter names. I don't want to
handle that in this first revision of the check though.

- Ben

>
>> http://reviews.llvm.org/D4518
>>
>> Files:
>>   clang-tidy/google/CMakeLists.txt
>>   clang-tidy/google/GoogleTidyModule.cpp
>>   clang-tidy/google/NamedParameterCheck.cpp
>>   clang-tidy/google/NamedParameterCheck.h
>>   test/clang-tidy/google-readability-function.cpp
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>



More information about the cfe-commits mailing list