1 .. title:: clang-tidy - bugprone-argument-comment
3 bugprone-argument-comment
4 =========================
6 Checks that argument comments match parameter names.
8 The check understands argument comments in the form ``/*parameter_name=*/``
9 that are placed right before the argument.
18 // warning: argument name 'bar' in comment does not match parameter name 'foo'
20 The check tries to detect typos and suggest automated fixes for them.
25 .. option:: StrictMode
27 When `false` (default value), the check will ignore leading and trailing
28 underscores and case when comparing names -- otherwise they are taken into
31 .. option:: IgnoreSingleArgument
33 When `true`, the check will ignore the single argument.
35 .. option:: CommentBoolLiterals
37 When `true`, the check will add argument comments in the format
38 ``/*ParameterName=*/`` right before the boolean literal argument.
44 void foo(bool TurnKey, bool PressButton);
52 void foo(bool TurnKey, bool PressButton);
54 foo(/*TurnKey=*/true, /*PressButton=*/false);
56 .. option:: CommentIntegerLiterals
58 When true, the check will add argument comments in the format
59 ``/*ParameterName=*/`` right before the integer literal argument.
65 void foo(int MeaningOfLife);
73 void foo(int MeaningOfLife);
75 foo(/*MeaningOfLife=*/42);
77 .. option:: CommentFloatLiterals
79 When true, the check will add argument comments in the format
80 ``/*ParameterName=*/`` right before the float/double literal argument.
98 .. option:: CommentStringLiterals
100 When true, the check will add argument comments in the format
101 ``/*ParameterName=*/`` right before the string literal argument.
107 void foo(const char *String);
108 void foo(const wchar_t *WideString);
117 void foo(const char *String);
118 void foo(const wchar_t *WideString);
120 foo(/*String=*/"Hello World");
121 foo(/*WideString=*/L"Hello World");
123 .. option:: CommentCharacterLiterals
125 When true, the check will add argument comments in the format
126 ``/*ParameterName=*/`` right before the character literal argument.
132 void foo(char *Character);
140 void foo(char *Character);
142 foo(/*Character=*/'A');
144 .. option:: CommentUserDefinedLiterals
146 When true, the check will add argument comments in the format
147 ``/*ParameterName=*/`` right before the user defined literal argument.
153 void foo(double Distance);
155 double operator"" _km(long double);
163 void foo(double Distance);
165 double operator"" _km(long double);
167 foo(/*Distance=*/402.0_km);
169 .. option:: CommentNullPtrs
171 When true, the check will add argument comments in the format
172 ``/*ParameterName=*/`` right before the nullptr literal argument.
188 foo(/*Value=*/nullptr);