1 | // RUN: %check_clang_tidy %s readability-identifier-naming %t -- \ |
2 | // RUN: -config='{CheckOptions: { \ |
3 | // RUN: readability-identifier-naming.ParameterCase: lower_case \ |
4 | // RUN: }}' |
5 | |
6 | int func(int Break) { |
7 | // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for parameter 'Break'; cannot be fixed because 'break' would conflict with a keyword |
8 | // CHECK-FIXES: {{^}}int func(int Break) {{{$}} |
9 | if (Break == 1) { |
10 | // CHECK-FIXES: {{^}} if (Break == 1) {{{$}} |
11 | return 2; |
12 | } |
13 | |
14 | return 0; |
15 | } |
16 | |
17 | #define foo 3 |
18 | int func2(int Foo) { |
19 | // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for parameter 'Foo'; cannot be fixed because 'foo' would conflict with a macro definition |
20 | // CHECK-FIXES: {{^}}int func2(int Foo) {{{$}} |
21 | if (Foo == 1) { |
22 | // CHECK-FIXES: {{^}} if (Foo == 1) {{{$}} |
23 | return 2; |
24 | } |
25 | |
26 | return 0; |
27 | } |
28 | |
29 | int func3(int _0Bad) { |
30 | // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for parameter '_0Bad'; cannot be fixed automatically [readability-identifier-naming] |
31 | // CHECK-FIXES: {{^}}int func3(int _0Bad) {{{$}} |
32 | if (_0Bad == 1) { |
33 | // CHECK-FIXES: {{^}} if (_0Bad == 1) {{{$}} |
34 | return 2; |
35 | } |
36 | return 0; |
37 | } |
38 | |