xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/readability/named-parameter.rst (revision 47a40e80c553b07a08f0f17fd68c12ae9b9a2a67)
1.. title:: clang-tidy - readability-named-parameter
2
3readability-named-parameter
4===========================
5
6Find functions with unnamed arguments.
7
8The check implements the following rule originating in the Google C++ Style
9Guide:
10
11https://google.github.io/styleguide/cppguide.html#Function_Declarations_and_Definitions
12
13All parameters should have the same name in both the function declaration and definition.
14If a parameter is not utilized, its name can be commented out in a function definition.
15
16.. code-block:: c++
17
18    int doingSomething(int a, int b, int c);
19
20    int doingSomething(int a, int b, int /*c*/) {
21        // Ok: the third param is not used
22        return a + b;
23    }
24
25Corresponding cpplint.py check name: `readability/function`.
26