36 lines · plain
1.. title:: clang-tidy - readability-named-parameter2 3readability-named-parameter4===========================5 6Find functions with unnamed arguments.7 8The check implements the following rule originating in the Google C++ Style9Guide:10 11https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions12 13All parameters should have the same name in both the function declaration and14definition. If a parameter is not utilized, its name can be commented out in a15function definition.16 17.. code-block:: c++18 19 int doingSomething(int a, int b, int c);20 21 int doingSomething(int a, int b, int /*c*/) {22 // Ok: the third param is not used23 return a + b;24 }25 26Corresponding cpplint.py check name: `readability/function`.27 28Options29-------30 31.. option:: InsertPlainNamesInForwardDecls32 33 If set to `true`, the check will insert parameter names without comments for34 forward declarations only. Otherwise, the check will insert parameter names35 as comments (e.g., ``/*param*/``). Default is `false`.36