You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[NFC][clang-tidy] Remove {{^}} clauses in some tests (3/N) (#135826)
`check_clang_tidy` now matches full lines only, so `{{^}}` clauses are
no longer necessary.
I am splitting those changes over multiple PRs to make review easier.
Numbering them but the actual order doesn't matter.
Copy file name to clipboardExpand all lines: clang-tools-extra/test/clang-tidy/checkers/bugprone/reserved-identifier.cpp
+36-36
Original file line number
Diff line number
Diff line change
@@ -8,35 +8,35 @@
8
8
9
9
#define_MACRO(m) int m = 0
10
10
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: declaration uses identifier '_MACRO', which is a reserved identifier [bugprone-reserved-identifier]
11
-
// CHECK-FIXES: {{^}}#define MACRO(m) int m = 0{{$}}
11
+
// CHECK-FIXES: #define MACRO(m) int m = 0
12
12
13
13
namespace_Ns {
14
14
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: declaration uses identifier '_Ns', which is a reserved identifier [bugprone-reserved-identifier]
15
-
// CHECK-FIXES: {{^}}namespace Ns {{{$}}
15
+
// CHECK-FIXES: namespace Ns {
16
16
17
17
class_Object {
18
18
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '_Object', which is a reserved identifier [bugprone-reserved-identifier]
19
-
// CHECK-FIXES: {{^}}class Object {{{$}}
19
+
// CHECK-FIXES: class Object {
20
20
int _Member;
21
21
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '_Member', which is a reserved identifier [bugprone-reserved-identifier]
22
-
// CHECK-FIXES: {{^}} int Member;{{$}}
22
+
// CHECK-FIXES: int Member;
23
23
};
24
24
25
25
float _Global;
26
26
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '_Global', which is a reserved identifier [bugprone-reserved-identifier]
27
-
// CHECK-FIXES: {{^}}float Global;{{$}}
27
+
// CHECK-FIXES: float Global;
28
28
29
29
void_Function() {}
30
30
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration uses identifier '_Function', which is a reserved identifier [bugprone-reserved-identifier]
31
-
// CHECK-FIXES: {{^}}void Function() {}{{$}}
31
+
// CHECK-FIXES: void Function() {}
32
32
33
33
using _Alias = int;
34
34
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '_Alias', which is a reserved identifier [bugprone-reserved-identifier]
35
-
// CHECK-FIXES: {{^}}using Alias = int;{{$}}
35
+
// CHECK-FIXES: using Alias = int;
36
36
37
37
template <typename _TemplateParam>
38
38
// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: declaration uses identifier '_TemplateParam', which is a reserved identifier [bugprone-reserved-identifier]
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: declaration uses identifier '__macro', which is a reserved identifier [bugprone-reserved-identifier]
48
-
// CHECK-FIXES: {{^}}#define _macro(m) int m = 0{{$}}
48
+
// CHECK-FIXES: #define _macro(m) int m = 0
49
49
50
50
namespace__ns {
51
51
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: declaration uses identifier '__ns', which is a reserved identifier [bugprone-reserved-identifier]
52
-
// CHECK-FIXES: {{^}}namespace ns {{{$}}
52
+
// CHECK-FIXES: namespace ns {
53
53
class__object {
54
54
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '__object', which is a reserved identifier [bugprone-reserved-identifier]
55
-
// CHECK-FIXES: {{^}}class _object {{{$}}
55
+
// CHECK-FIXES: class _object {
56
56
int __member;
57
57
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '__member', which is a reserved identifier [bugprone-reserved-identifier]
58
-
// CHECK-FIXES: {{^}} int _member;{{$}}
58
+
// CHECK-FIXES: int _member;
59
59
};
60
60
61
61
float __global;
62
62
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '__global', which is a reserved identifier [bugprone-reserved-identifier]
63
-
// CHECK-FIXES: {{^}}float _global;{{$}}
63
+
// CHECK-FIXES: float _global;
64
64
65
65
void__function() {}
66
66
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration uses identifier '__function', which is a reserved identifier [bugprone-reserved-identifier]
67
-
// CHECK-FIXES: {{^}}void _function() {}{{$}}
67
+
// CHECK-FIXES: void _function() {}
68
68
69
69
using __alias = int;
70
70
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '__alias', which is a reserved identifier [bugprone-reserved-identifier]
71
-
// CHECK-FIXES: {{^}}using _alias = int;{{$}}
71
+
// CHECK-FIXES: using _alias = int;
72
72
73
73
template <typename __templateParam>
74
74
// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: declaration uses identifier '__templateParam', which is a reserved identifier [bugprone-reserved-identifier]
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: declaration uses identifier 'macro___m', which is a reserved identifier [bugprone-reserved-identifier]
84
-
// CHECK-FIXES: {{^}}#define macro_m(m) int m = 0{{$}}
84
+
// CHECK-FIXES: #define macro_m(m) int m = 0
85
85
86
86
namespacens___n {
87
87
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: declaration uses identifier 'ns___n', which is a reserved identifier [bugprone-reserved-identifier]
88
-
// CHECK-FIXES: {{^}}namespace ns_n {{{$}}
88
+
// CHECK-FIXES: namespace ns_n {
89
89
classobject___o {
90
90
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier 'object___o', which is a reserved identifier [bugprone-reserved-identifier]
91
-
// CHECK-FIXES: {{^}}class object_o {{{$}}
91
+
// CHECK-FIXES: class object_o {
92
92
int member___m;
93
93
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier 'member___m', which is a reserved identifier [bugprone-reserved-identifier]
94
-
// CHECK-FIXES: {{^}} int member_m;{{$}}
94
+
// CHECK-FIXES: int member_m;
95
95
};
96
96
97
97
float global___g;
98
98
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier 'global___g', which is a reserved identifier [bugprone-reserved-identifier]
99
-
// CHECK-FIXES: {{^}}float global_g;{{$}}
99
+
// CHECK-FIXES: float global_g;
100
100
101
101
voidfunction___f() {}
102
102
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration uses identifier 'function___f', which is a reserved identifier [bugprone-reserved-identifier]
103
-
// CHECK-FIXES: {{^}}void function_f() {}{{$}}
103
+
// CHECK-FIXES: void function_f() {}
104
104
105
105
using alias___a = int;
106
106
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier 'alias___a', which is a reserved identifier [bugprone-reserved-identifier]
107
-
// CHECK-FIXES: {{^}}using alias_a = int;{{$}}
107
+
// CHECK-FIXES: using alias_a = int;
108
108
109
109
template <typename templateParam___t>
110
110
// CHECK-MESSAGES: :[[@LINE-1]]:20: warning: declaration uses identifier 'templateParam___t', which is a reserved identifier [bugprone-reserved-identifier]
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: declaration uses identifier '_ns', which is reserved in the global namespace [bugprone-reserved-identifier]
124
-
// CHECK-FIXES: {{^}}namespace ns {{{$}}
124
+
// CHECK-FIXES: namespace ns {
125
125
int _i;
126
126
// no warning
127
127
} // namespace _ns
128
128
class_object {
129
129
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '_object', which is reserved in the global namespace [bugprone-reserved-identifier]
130
-
// CHECK-FIXES: {{^}}class object {{{$}}
130
+
// CHECK-FIXES: class object {
131
131
int _member;
132
132
// no warning
133
133
};
134
134
float _global;
135
135
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '_global', which is reserved in the global namespace [bugprone-reserved-identifier]
136
-
// CHECK-FIXES: {{^}}float global;{{$}}
136
+
// CHECK-FIXES: float global;
137
137
void_function() {}
138
138
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration uses identifier '_function', which is reserved in the global namespace [bugprone-reserved-identifier]
139
-
// CHECK-FIXES: {{^}}void function() {}{{$}}
139
+
// CHECK-FIXES: void function() {}
140
140
using _alias = int;
141
141
// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: declaration uses identifier '_alias', which is reserved in the global namespace [bugprone-reserved-identifier]
142
-
// CHECK-FIXES: {{^}}using alias = int;{{$}}
142
+
// CHECK-FIXES: using alias = int;
143
143
template <typename _templateParam> // no warning, template params are not in the global namespace
144
144
structS {};
145
145
146
146
void_float() {}
147
147
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration uses identifier '_float', which is reserved in the global namespace; cannot be fixed because 'float' would conflict with a keyword [bugprone-reserved-identifier]
148
-
// CHECK-FIXES: {{^}}void _float() {}{{$}}
148
+
// CHECK-FIXES: void _float() {}
149
149
150
150
#defineSOME_MACRO
151
151
int SOME__MACRO;
152
152
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: declaration uses identifier 'SOME__MACRO', which is a reserved identifier; cannot be fixed because 'SOME_MACRO' would conflict with a macro definition [bugprone-reserved-identifier]
153
-
// CHECK-FIXES: {{^}}int SOME__MACRO;{{$}}
153
+
// CHECK-FIXES: int SOME__MACRO;
154
154
155
155
void_TWO__PROBLEMS() {}
156
156
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration uses identifier '_TWO__PROBLEMS', which is a reserved identifier [bugprone-reserved-identifier]
157
-
// CHECK-FIXES: {{^}}void TWO_PROBLEMS() {}{{$}}
157
+
// CHECK-FIXES: void TWO_PROBLEMS() {}
158
158
void_two__problems() {}
159
159
// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: declaration uses identifier '_two__problems', which is a reserved identifier [bugprone-reserved-identifier]
160
-
// CHECK-FIXES: {{^}}void two_problems() {}{{$}}
160
+
// CHECK-FIXES: void two_problems() {}
161
161
162
162
int __;
163
163
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: declaration uses identifier '__', which is a reserved identifier; cannot be fixed automatically [bugprone-reserved-identifier]
164
-
// CHECK-FIXES: {{^}}int __;{{$}}
164
+
// CHECK-FIXES: int __;
165
165
166
166
int _________;
167
167
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: declaration uses identifier '_________', which is a reserved identifier; cannot be fixed automatically [bugprone-reserved-identifier]
168
-
// CHECK-FIXES: {{^}}int _________;{{$}}
168
+
// CHECK-FIXES: int _________;
169
169
170
170
int _;
171
171
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: declaration uses identifier '_', which is reserved in the global namespace; cannot be fixed automatically [bugprone-reserved-identifier]
Copy file name to clipboardExpand all lines: clang-tools-extra/test/clang-tidy/checkers/google/readability-casting.cpp
+12-12
Original file line number
Diff line number
Diff line change
@@ -16,32 +16,32 @@ void f(int a, double b, const char *cpc, const void *cpv, X *pX) {
16
16
Typedef1 t1;
17
17
(Typedef2)t1;
18
18
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: C-style casts are discouraged; use static_cast (if needed, the cast may be redundant) [google-readability-casting]
19
-
// CHECK-FIXES: {{^}} static_cast<Typedef2>(t1);
19
+
// CHECK-FIXES: static_cast<Typedef2>(t1);
20
20
(constchar*)t1;
21
21
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: {{.*}}; use static_cast (if needed
0 commit comments