xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp (revision c79e5acfe8d4bb01d5ae7297dcb900ad8c39c580)
1 // Remove UNSUPPORTED for powerpc64le when the problem introduced by
2 // r288563 is resolved.
3 // UNSUPPORTED: target=powerpc64le{{.*}}
4 // RUN: %check_clang_tidy -std=c++20 %s readability-identifier-naming %t -- \
5 // RUN:   -config='{CheckOptions: { \
6 // RUN:     readability-identifier-naming.AbstractClassCase: CamelCase, \
7 // RUN:     readability-identifier-naming.AbstractClassPrefix: 'A', \
8 // RUN:     readability-identifier-naming.ClassCase: CamelCase, \
9 // RUN:     readability-identifier-naming.ClassPrefix: 'C', \
10 // RUN:     readability-identifier-naming.ClassConstantCase: CamelCase, \
11 // RUN:     readability-identifier-naming.ClassConstantPrefix: 'k', \
12 // RUN:     readability-identifier-naming.ClassMemberCase: CamelCase, \
13 // RUN:     readability-identifier-naming.ClassMethodCase: camelBack, \
14 // RUN:     readability-identifier-naming.ConceptCase: CamelCase, \
15 // RUN:     readability-identifier-naming.ConstantCase: UPPER_CASE, \
16 // RUN:     readability-identifier-naming.ConstantSuffix: '_CST', \
17 // RUN:     readability-identifier-naming.ConstexprFunctionCase: lower_case, \
18 // RUN:     readability-identifier-naming.ConstexprMethodCase: lower_case, \
19 // RUN:     readability-identifier-naming.ConstexprVariableCase: lower_case, \
20 // RUN:     readability-identifier-naming.EnumCase: CamelCase, \
21 // RUN:     readability-identifier-naming.EnumPrefix: 'E', \
22 // RUN:     readability-identifier-naming.ScopedEnumConstantCase: CamelCase, \
23 // RUN:     readability-identifier-naming.EnumConstantCase: UPPER_CASE, \
24 // RUN:     readability-identifier-naming.FunctionCase: camelBack, \
25 // RUN:     readability-identifier-naming.GlobalConstantCase: UPPER_CASE, \
26 // RUN:     readability-identifier-naming.GlobalFunctionCase: CamelCase, \
27 // RUN:     readability-identifier-naming.GlobalVariableCase: lower_case, \
28 // RUN:     readability-identifier-naming.GlobalVariablePrefix: 'g_', \
29 // RUN:     readability-identifier-naming.InlineNamespaceCase: lower_case, \
30 // RUN:     readability-identifier-naming.LocalConstantCase: CamelCase, \
31 // RUN:     readability-identifier-naming.LocalConstantPrefix: 'k', \
32 // RUN:     readability-identifier-naming.LocalVariableCase: lower_case, \
33 // RUN:     readability-identifier-naming.MemberCase: CamelCase, \
34 // RUN:     readability-identifier-naming.MemberPrefix: 'm_', \
35 // RUN:     readability-identifier-naming.ConstantMemberCase: lower_case, \
36 // RUN:     readability-identifier-naming.PrivateMemberPrefix: '__', \
37 // RUN:     readability-identifier-naming.ProtectedMemberPrefix: '_', \
38 // RUN:     readability-identifier-naming.PublicMemberCase: lower_case, \
39 // RUN:     readability-identifier-naming.MethodCase: camelBack, \
40 // RUN:     readability-identifier-naming.PrivateMethodPrefix: '__', \
41 // RUN:     readability-identifier-naming.ProtectedMethodPrefix: '_', \
42 // RUN:     readability-identifier-naming.NamespaceCase: lower_case, \
43 // RUN:     readability-identifier-naming.ParameterCase: camelBack, \
44 // RUN:     readability-identifier-naming.ParameterPrefix: 'a_', \
45 // RUN:     readability-identifier-naming.ConstantParameterCase: camelBack, \
46 // RUN:     readability-identifier-naming.ConstantParameterPrefix: 'i_', \
47 // RUN:     readability-identifier-naming.ParameterPackCase: camelBack, \
48 // RUN:     readability-identifier-naming.PureFunctionCase: lower_case, \
49 // RUN:     readability-identifier-naming.PureMethodCase: camelBack, \
50 // RUN:     readability-identifier-naming.StaticConstantCase: UPPER_CASE, \
51 // RUN:     readability-identifier-naming.StaticVariableCase: camelBack, \
52 // RUN:     readability-identifier-naming.StaticVariablePrefix: 's_', \
53 // RUN:     readability-identifier-naming.StructCase: Leading_upper_snake_case, \
54 // RUN:     readability-identifier-naming.TemplateParameterCase: UPPER_CASE, \
55 // RUN:     readability-identifier-naming.TemplateTemplateParameterCase: CamelCase, \
56 // RUN:     readability-identifier-naming.TemplateUsingCase: lower_case, \
57 // RUN:     readability-identifier-naming.TemplateUsingPrefix: 'u_', \
58 // RUN:     readability-identifier-naming.TypeTemplateParameterCase: camelBack, \
59 // RUN:     readability-identifier-naming.TypeTemplateParameterSuffix: '_t', \
60 // RUN:     readability-identifier-naming.TypedefCase: lower_case, \
61 // RUN:     readability-identifier-naming.TypedefSuffix: '_t', \
62 // RUN:     readability-identifier-naming.UnionCase: CamelCase, \
63 // RUN:     readability-identifier-naming.UnionPrefix: 'U', \
64 // RUN:     readability-identifier-naming.UsingCase: lower_case, \
65 // RUN:     readability-identifier-naming.ValueTemplateParameterCase: camelBack, \
66 // RUN:     readability-identifier-naming.VariableCase: lower_case, \
67 // RUN:     readability-identifier-naming.VirtualMethodCase: Camel_Snake_Case, \
68 // RUN:     readability-identifier-naming.VirtualMethodPrefix: 'v_', \
69 // RUN:     readability-identifier-naming.MacroDefinitionCase: UPPER_CASE, \
70 // RUN:     readability-identifier-naming.TypeAliasCase: camel_Snake_Back, \
71 // RUN:     readability-identifier-naming.TypeAliasSuffix: '_t', \
72 // RUN:     readability-identifier-naming.IgnoreFailedSplit: false, \
73 // RUN:     readability-identifier-naming.GlobalPointerCase: CamelCase, \
74 // RUN:     readability-identifier-naming.GlobalPointerSuffix: '_Ptr', \
75 // RUN:     readability-identifier-naming.GlobalConstantPointerCase: UPPER_CASE, \
76 // RUN:     readability-identifier-naming.GlobalConstantPointerSuffix: '_Ptr', \
77 // RUN:     readability-identifier-naming.PointerParameterCase: lower_case, \
78 // RUN:     readability-identifier-naming.PointerParameterPrefix: 'p_', \
79 // RUN:     readability-identifier-naming.ConstantPointerParameterCase: CamelCase, \
80 // RUN:     readability-identifier-naming.ConstantPointerParameterPrefix: 'cp_', \
81 // RUN:     readability-identifier-naming.LocalPointerCase: CamelCase, \
82 // RUN:     readability-identifier-naming.LocalPointerPrefix: 'l_', \
83 // RUN:     readability-identifier-naming.LocalConstantPointerCase: CamelCase, \
84 // RUN:     readability-identifier-naming.LocalConstantPointerPrefix: 'lc_', \
85 // RUN:   }}' -- -fno-delayed-template-parsing -Dbad_macro \
86 // RUN:   -I%S/Inputs/identifier-naming \
87 // RUN:   -isystem %S/Inputs/identifier-naming/system
88 
89 // clang-format off
90 
91 #include <system-header.h>
92 #include <coroutines.h>
93 #include "user-header.h"
94 // NO warnings or fixes expected from declarations within header files without
95 // the -header-filter= option
96 
97 namespace FOO_NS {
98 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for namespace 'FOO_NS' [readability-identifier-naming]
99 // CHECK-FIXES: {{^}}namespace foo_ns {{{$}}
100 inline namespace InlineNamespace {
101 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for inline namespace 'InlineNamespace'
102 // CHECK-FIXES: {{^}}inline namespace inline_namespace {{{$}}
103 
104 namespace FOO_ALIAS = FOO_NS;
105 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for namespace 'FOO_ALIAS' [readability-identifier-naming]
106 // CHECK-FIXES: {{^}}namespace foo_alias = FOO_NS;{{$}}
107 
108 SYSTEM_NS::structure g_s1;
109 // NO warnings or fixes expected as SYSTEM_NS and structure are declared in a header file
110 
111 USER_NS::object g_s2;
112 // NO warnings or fixes expected as USER_NS and object are declared in a header file
113 
114 SYSTEM_MACRO(var1);
115 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'var1' [readability-identifier-naming]
116 // CHECK-FIXES: {{^}}SYSTEM_MACRO(g_var1);
117 
118 USER_MACRO(var2);
119 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'var2' [readability-identifier-naming]
120 // CHECK-FIXES: {{^}}USER_MACRO(g_var2);
121 
122 #define BLA int FOO_bar
123 BLA;
124 // NO warnings or fixes expected as FOO_bar is from macro expansion
125 
126 int global0;
127 #define USE_NUMBERED_GLOBAL(number) auto use_global##number = global##number
128 USE_NUMBERED_GLOBAL(0);
129 // NO warnings or fixes expected as global0 is pieced together in a macro
130 // expansion.
131 
132 int global1;
133 #define USE_NUMBERED_BAL(prefix, number) \
134   auto use_##prefix##bal##number = prefix##bal##number
135 USE_NUMBERED_BAL(glo, 1);
136 // NO warnings or fixes expected as global1 is pieced together in a macro
137 // expansion.
138 
139 int global2;
140 #define USE_RECONSTRUCTED(glo, bal) auto use_##glo##bal = glo##bal
141 USE_RECONSTRUCTED(glo, bal2);
142 // NO warnings or fixes expected as global2 is pieced together in a macro
143 // expansion.
144 
145 int global;
146 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'global'
147 // CHECK-FIXES: {{^}}int g_global;{{$}}
148 #define USE_IN_MACRO(m) auto use_##m = m
149 USE_IN_MACRO(global);
150 
151 int global3;
152 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'global3'
153 // CHECK-FIXES: {{^}}int g_global3;{{$}}
154 #define ADD_TO_SELF(m) (m) + (m)
155 int g_twice_global3 = ADD_TO_SELF(global3);
156 // CHECK-FIXES: {{^}}int g_twice_global3 = ADD_TO_SELF(g_global3);{{$}}
157 
158 int g_Global4;
159 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'g_Global4'
160 // CHECK-FIXES: {{^}}int g_global4;{{$}}
161 
162 enum my_enumeration {
163 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for enum 'my_enumeration'
164 // CHECK-FIXES: {{^}}enum EMyEnumeration {{{$}}
165     MyConstant = 1,
166 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for enum constant 'MyConstant'
167 // CHECK-FIXES: {{^}}    MY_CONSTANT = 1,{{$}}
168     your_CONST = 1,
169 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for enum constant 'your_CONST'
170 // CHECK-FIXES: {{^}}    YOUR_CONST = 1,{{$}}
171     THIS_ConstValue = 1,
172 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for enum constant 'THIS_ConstValue'
173 // CHECK-FIXES: {{^}}    THIS_CONST_VALUE = 1,{{$}}
174 };
175 
176 enum class EMyEnumeration {
177     myConstant = 1,
178 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for scoped enum constant 'myConstant'
179 // CHECK-FIXES: {{^}}    MyConstant = 1,{{$}}
180     your_CONST = 1,
181 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for scoped enum constant 'your_CONST'
182 // CHECK-FIXES: {{^}}    YourConst = 1,{{$}}
183     THIS_ConstValue = 1,
184 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for scoped enum constant 'THIS_ConstValue'
185 // CHECK-FIXES: {{^}}    ThisConstValue = 1,{{$}}
186 };
187 
188 constexpr int ConstExpr_variable = MyConstant;
189 // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for constexpr variable 'ConstExpr_variable'
190 // CHECK-FIXES: {{^}}constexpr int const_expr_variable = MY_CONSTANT;{{$}}
191 
192 class my_class {
193 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'my_class'
194 // CHECK-FIXES: {{^}}class CMyClass {{{$}}
195 public:
196     my_class();
197 // CHECK-FIXES: {{^}}    CMyClass();{{$}}
198 
199     my_class(void*) : my_class() {}
200 // CHECK-FIXES: {{^}}    CMyClass(void*) : CMyClass() {}{{$}}
201 
202     ~
203       my_class();
204 // (space in destructor token test, we could check trigraph but they will be deprecated)
205 // CHECK-FIXES: {{^}}    ~{{$}}
206 // CHECK-FIXES: {{^}}      CMyClass();{{$}}
207 
208 private:
209   const int MEMBER_one_1 = ConstExpr_variable;
210 // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for constant member 'MEMBER_one_1'
211 // CHECK-FIXES: {{^}}  const int member_one_1 = const_expr_variable;{{$}}
212   int member2 = 2;
213 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for private member 'member2'
214 // CHECK-FIXES: {{^}}  int __member2 = 2;{{$}}
215   int _memberWithExtraUnderscores_ = 42;
216 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for private member '_memberWithExtraUnderscores_'
217 // CHECK-FIXES: {{^}}  int __memberWithExtraUnderscores = 42;{{$}}
218 
219 private:
220     int private_member = 3;
221 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for private member 'private_member'
222 // CHECK-FIXES: {{^}}    int __private_member = 3;{{$}}
223 
224 protected:
225     int ProtMember;
226 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for protected member 'ProtMember'
227 // CHECK-FIXES: {{^}}    int _ProtMember;{{$}}
228 
229 public:
230     int PubMem;
231 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for public member 'PubMem'
232 // CHECK-FIXES: {{^}}    int pub_mem;{{$}}
233 
234     static const int classConstant;
235 // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: invalid case style for class constant 'classConstant'
236 // CHECK-FIXES: {{^}}    static const int kClassConstant;{{$}}
237     static int ClassMember_2;
238 // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for class member 'ClassMember_2'
239 // CHECK-FIXES: {{^}}    static int ClassMember2;{{$}}
240 };
241 class my_class;
242 // No warning needed here as this is tied to the previous declaration.
243 // Just make sure the fix is applied.
244 // CHECK-FIXES: {{^}}class CMyClass;{{$}}
245 
246 class my_forward_declared_class; // No warning should be triggered.
247 
248 const int my_class::classConstant = 4;
249 // CHECK-FIXES: {{^}}const int CMyClass::kClassConstant = 4;{{$}}
250 
251 int my_class::ClassMember_2 = 5;
252 // CHECK-FIXES: {{^}}int CMyClass::ClassMember2 = 5;{{$}}
253 
254 class my_derived_class : public virtual my_class {};
255 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'my_derived_class'
256 // CHECK-FIXES: {{^}}class CMyDerivedClass : public virtual CMyClass {};{{$}}
257 
258 class CMyWellNamedClass {};
259 // No warning expected as this class is well named.
260 
261 template<typename t_t>
262 concept MyConcept = requires (t_t a_t) { {a_t++}; };
263 // No warning expected as this concept is well named.
264 
265 template<typename t_t>
266 concept my_concept_2 = requires (t_t a_t) { {a_t++}; };
267 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for concept 'my_concept_2'
268 // CHECK-FIXES: {{^}}concept MyConcept2 = requires (t_t a_t) { {a_t++}; };{{$}}
269 
270 template <typename t_t>
271 class CMyWellNamedClass2 : public my_class {
272   // CHECK-FIXES: {{^}}class CMyWellNamedClass2 : public CMyClass {{{$}}
273   t_t my_Bad_Member;
274   // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for private member 'my_Bad_Member'
275   // CHECK-FIXES: {{^}}  t_t __my_Bad_Member;{{$}}
276   int my_Other_Bad_Member = 42;
277   // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for private member 'my_Other_Bad_Member'
278   // CHECK-FIXES: {{^}}  int __my_Other_Bad_Member = 42;{{$}}
279 public:
280   CMyWellNamedClass2() = default;
281   CMyWellNamedClass2(CMyWellNamedClass2 const&) = default;
282   CMyWellNamedClass2(CMyWellNamedClass2 &&) = default;
283   CMyWellNamedClass2(t_t a_v, void *p_p) : my_class(p_p), my_Bad_Member(a_v) {}
284   // CHECK-FIXES: {{^}}  CMyWellNamedClass2(t_t a_v, void *p_p) : CMyClass(p_p), __my_Bad_Member(a_v) {}{{$}}
285 
286   CMyWellNamedClass2(t_t a_v) : my_class(), my_Bad_Member(a_v), my_Other_Bad_Member(11) {}
287   // CHECK-FIXES: {{^}}  CMyWellNamedClass2(t_t a_v) : CMyClass(), __my_Bad_Member(a_v), __my_Other_Bad_Member(11) {}{{$}}
288 };
289 void InstantiateClassMethods() {
290   // Ensure we trigger the instantiation of each constructor
291   CMyWellNamedClass2<int> x;
292   CMyWellNamedClass2<int> x2 = x;
293   CMyWellNamedClass2<int> x3 = static_cast<CMyWellNamedClass2<int>&&>(x2);
294   CMyWellNamedClass2<int> x4(42);
295   CMyWellNamedClass2<int> x5(42, nullptr);
296 }
297 
298 class AOverridden {
299 public:
300   virtual ~AOverridden() = default;
301   virtual void BadBaseMethod() = 0;
302   // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for virtual method 'BadBaseMethod'
303   // CHECK-FIXES: {{^}}  virtual void v_Bad_Base_Method() = 0;
304 
305   virtual void BadBaseMethodNoAttr() = 0;
306   // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for virtual method 'BadBaseMethodNoAttr'
307   // CHECK-FIXES: {{^}}  virtual void v_Bad_Base_Method_No_Attr() = 0;
308 };
309 
310 class COverriding : public AOverridden {
311 public:
312   // Overriding a badly-named base isn't a new violation.
313   void BadBaseMethod() override {}
314   // CHECK-FIXES: {{^}}  void v_Bad_Base_Method() override {}
315 
316   void BadBaseMethodNoAttr() /* override */ {}
317   // CHECK-FIXES: {{^}}  void v_Bad_Base_Method_No_Attr() /* override */ {}
318 
319   void foo() {
320     BadBaseMethod();
321     // CHECK-FIXES: {{^}}    v_Bad_Base_Method();
322     this->BadBaseMethod();
323     // CHECK-FIXES: {{^}}    this->v_Bad_Base_Method();
324     AOverridden::BadBaseMethod();
325     // CHECK-FIXES: {{^}}    AOverridden::v_Bad_Base_Method();
326     COverriding::BadBaseMethod();
327     // CHECK-FIXES: {{^}}    COverriding::v_Bad_Base_Method();
328 
329     BadBaseMethodNoAttr();
330     // CHECK-FIXES: {{^}}    v_Bad_Base_Method_No_Attr();
331     this->BadBaseMethodNoAttr();
332     // CHECK-FIXES: {{^}}    this->v_Bad_Base_Method_No_Attr();
333     AOverridden::BadBaseMethodNoAttr();
334     // CHECK-FIXES: {{^}}    AOverridden::v_Bad_Base_Method_No_Attr();
335     COverriding::BadBaseMethodNoAttr();
336     // CHECK-FIXES: {{^}}    COverriding::v_Bad_Base_Method_No_Attr();
337   }
338 };
339 
340 // Same test as above, now with a dependent base class.
341 template<typename some_t>
342 class ATOverridden {
343 public:
344   virtual void BadBaseMethod() = 0;
345   // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for virtual method 'BadBaseMethod'
346   // CHECK-FIXES: {{^}}  virtual void v_Bad_Base_Method() = 0;
347 
348   virtual void BadBaseMethodNoAttr() = 0;
349   // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for virtual method 'BadBaseMethodNoAttr'
350   // CHECK-FIXES: {{^}}  virtual void v_Bad_Base_Method_No_Attr() = 0;
351 };
352 
353 template<typename some_t>
354 class CTOverriding : public ATOverridden<some_t> {
355   // Overriding a badly-named base isn't a new violation.
356   // FIXME: The fixes from the base class should be propagated to the derived class here
357   //        (note that there could be specializations of the template base class, though)
358   void BadBaseMethod() override {}
359 
360   // Without the "override" attribute, and due to the dependent base class, it is not
361   // known whether this method overrides anything, so we get the warning here.
362   virtual void BadBaseMethodNoAttr() {};
363   // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for virtual method 'BadBaseMethodNoAttr'
364   // CHECK-FIXES: {{^}}  virtual void v_Bad_Base_Method_No_Attr() {};
365 };
366 
367 template<typename some_t>
368 void VirtualCall(AOverridden &a_vItem, ATOverridden<some_t> &a_vTitem) {
369   a_vItem.BadBaseMethod();
370   // CHECK-FIXES: {{^}}  a_vItem.v_Bad_Base_Method();
371 
372   // FIXME: The fixes from ATOverridden should be propagated to the following call
373   a_vTitem.BadBaseMethod();
374 }
375 
376 // Same test as above, now with a dependent base class that is instantiated below.
377 template<typename some_t>
378 class ATIOverridden {
379 public:
380   virtual void BadBaseMethod() = 0;
381   // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for virtual method 'BadBaseMethod'
382   // CHECK-FIXES: {{^}}  virtual void v_Bad_Base_Method() = 0;
383 };
384 
385 template<typename some_t>
386 class CTIOverriding : public ATIOverridden<some_t> {
387 public:
388   // Overriding a badly-named base isn't a new violation.
389   void BadBaseMethod() override {}
390   // CHECK-FIXES: {{^}}  void v_Bad_Base_Method() override {}
391 };
392 
393 template class CTIOverriding<int>;
394 
395 void VirtualCallI(ATIOverridden<int>& a_vItem, CTIOverriding<int>& a_vCitem) {
396   a_vItem.BadBaseMethod();
397   // CHECK-FIXES: {{^}}  a_vItem.v_Bad_Base_Method();
398 
399   a_vCitem.BadBaseMethod();
400   // CHECK-FIXES: {{^}}  a_vCitem.v_Bad_Base_Method();
401 }
402 
403 template <typename derived_t>
404 class CRTPBase {
405 public:
406   void BadBaseMethod(int) {}
407   // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for method 'BadBaseMethod'
408 };
409 
410 class CRTPDerived : CRTPBase<CRTPDerived> {
411 public:
412   // Hiding a badly-named base isn't a new violation.
413   double BadBaseMethod(double) { return 0; }
414 };
415 
416 template<typename T>
417 // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: invalid case style for type template parameter 'T'
418 // CHECK-FIXES: {{^}}template<typename t_t>{{$}}
419 class my_templated_class : CMyWellNamedClass {};
420 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'my_templated_class'
421 // CHECK-FIXES: {{^}}class CMyTemplatedClass : CMyWellNamedClass {};{{$}}
422 
423 template<typename T>
424 // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: invalid case style for type template parameter 'T'
425 // CHECK-FIXES: {{^}}template<typename t_t>{{$}}
426 class my_other_templated_class : my_templated_class<  my_class>, private my_derived_class {};
427 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'my_other_templated_class'
428 // CHECK-FIXES: {{^}}class CMyOtherTemplatedClass : CMyTemplatedClass<  CMyClass>, private CMyDerivedClass {};{{$}}
429 
430 template<typename t_t>
431 using mysuper_tpl_t = my_other_templated_class  <:: FOO_NS  ::my_class>;
432 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for type alias 'mysuper_tpl_t'
433 // CHECK-FIXES: {{^}}using mysuper_Tpl_t = CMyOtherTemplatedClass  <:: foo_ns  ::CMyClass>;{{$}}
434 
435 const int global_Constant = 6;
436 // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for global constant 'global_Constant'
437 // CHECK-FIXES: {{^}}const int GLOBAL_CONSTANT = 6;{{$}}
438 int Global_variable = 7;
439 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for global variable 'Global_variable'
440 // CHECK-FIXES: {{^}}int g_global_variable = 7;{{$}}
441 
442 void global_function(int PARAMETER_1, int const CONST_parameter) {
443 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global function 'global_function'
444 // CHECK-MESSAGES: :[[@LINE-2]]:26: warning: invalid case style for parameter 'PARAMETER_1'
445 // CHECK-MESSAGES: :[[@LINE-3]]:49: warning: invalid case style for constant parameter 'CONST_parameter'
446 // CHECK-FIXES: {{^}}void GlobalFunction(int a_parameter1, int const i_constParameter) {{{$}}
447     static const int THIS_static_ConsTant = 4;
448 // CHECK-MESSAGES: :[[@LINE-1]]:22: warning: invalid case style for static constant 'THIS_static_ConsTant'
449 // CHECK-FIXES: {{^}}    static const int THIS_STATIC_CONS_TANT = 4;{{$}}
450     static int THIS_static_variable;
451 // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for static variable 'THIS_static_variable'
452 // CHECK-FIXES: {{^}}    static int s_thisStaticVariable;{{$}}
453     int const local_Constant = 3;
454 // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for local constant 'local_Constant'
455 // CHECK-FIXES: {{^}}    int const kLocalConstant = 3;{{$}}
456     int LOCAL_VARIABLE;
457 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for local variable 'LOCAL_VARIABLE'
458 // CHECK-FIXES: {{^}}    int local_variable;{{$}}
459 
460     int LOCAL_Array__[] = {0, 1, 2};
461 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for local variable 'LOCAL_Array__'
462 // CHECK-FIXES: {{^}}    int local_array[] = {0, 1, 2};{{$}}
463 
464     for (auto _ : LOCAL_Array__) {
465     }
466 }
467 
468 template<typename ... TYPE_parameters>
469 // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: invalid case style for type template parameter 'TYPE_parameters'
470 // CHECK-FIXES: {{^}}template<typename ... typeParameters_t>{{$}}
471 void Global_Fun(TYPE_parameters... PARAMETER_PACK) {
472 // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for global function 'Global_Fun'
473 // CHECK-MESSAGES: :[[@LINE-2]]:36: warning: invalid case style for parameter pack 'PARAMETER_PACK'
474 // CHECK-FIXES: {{^}}void GlobalFun(typeParameters_t... parameterPack) {{{$}}
475     global_function(1, 2);
476 // CHECK-FIXES: {{^}}    GlobalFunction(1, 2);{{$}}
477     FOO_bar = Global_variable;
478 // CHECK-FIXES: {{^}}    FOO_bar = g_global_variable;{{$}}
479 // NO fix expected for FOO_bar declared in macro expansion
480 }
481 
482 template<template<typename> class TPL_parameter, int COUNT_params, typename ... TYPE_parameters>
483 // CHECK-MESSAGES: :[[@LINE-1]]:35: warning: invalid case style for template template parameter 'TPL_parameter'
484 // CHECK-MESSAGES: :[[@LINE-2]]:54: warning: invalid case style for value template parameter 'COUNT_params'
485 // CHECK-MESSAGES: :[[@LINE-3]]:81: warning: invalid case style for type template parameter 'TYPE_parameters'
486 // CHECK-FIXES: {{^}}template<template<typename> class TplParameter, int countParams, typename ... typeParameters_t>{{$}}
487 class test_CLASS {
488 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'test_CLASS'
489 // CHECK-FIXES: {{^}}class CTestClass {{{$}}
490 };
491 
492 class abstract_class {
493 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for abstract class 'abstract_class'
494 // CHECK-FIXES: {{^}}class AAbstractClass {{{$}}
495     virtual ~abstract_class() = 0;
496 // CHECK-FIXES: {{^}}    virtual ~AAbstractClass() = 0;{{$}}
497     virtual void VIRTUAL_METHOD();
498 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for virtual method 'VIRTUAL_METHOD'
499 // CHECK-FIXES: {{^}}    virtual void v_Virtual_Method();{{$}}
500     void non_Virtual_METHOD() {}
501 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for private method 'non_Virtual_METHOD'
502 // CHECK-FIXES: {{^}}    void __non_Virtual_METHOD() {}{{$}}
503 
504 public:
505     static void CLASS_METHOD() {}
506 // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for class method 'CLASS_METHOD'
507 // CHECK-FIXES: {{^}}    static void classMethod() {}{{$}}
508 
509     constexpr int CST_expr_Method() { return 2; }
510 // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: invalid case style for constexpr method 'CST_expr_Method'
511 // CHECK-FIXES: {{^}}    constexpr int cst_expr_method() { return 2; }{{$}}
512 
513 private:
514     void PRIVate_Method();
515 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for private method 'PRIVate_Method'
516 // CHECK-FIXES: {{^}}    void __PRIVate_Method();{{$}}
517 protected:
518     void protected_Method();
519 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for protected method 'protected_Method'
520 // CHECK-FIXES: {{^}}    void _protected_Method();{{$}}
521 public:
522     void public_Method();
523 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for method 'public_Method'
524 // CHECK-FIXES: {{^}}    void publicMethod();{{$}}
525 };
526 
527 constexpr int CE_function() { return 3; }
528 // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for constexpr function 'CE_function'
529 // CHECK-FIXES: {{^}}constexpr int ce_function() { return 3; }{{$}}
530 
531 struct THIS___Structure {
532 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'THIS___Structure'
533 // CHECK-FIXES: {{^}}struct This_structure {{{$}}
534     THIS___Structure();
535 // CHECK-FIXES: {{^}}    This_structure();{{$}}
536 
537   union __MyUnion_is_wonderful__ {};
538 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for union '__MyUnion_is_wonderful__'
539 // CHECK-FIXES: {{^}}  union UMyUnionIsWonderful {};{{$}}
540 };
541 
542 typedef THIS___Structure struct_type;
543 // CHECK-MESSAGES: :[[@LINE-1]]:26: warning: invalid case style for typedef 'struct_type'
544 // CHECK-FIXES: {{^}}typedef This_structure struct_type_t;{{$}}
545 
546 struct_type GlobalTypedefTestFunction(struct_type a_argument1) {
547 // CHECK-FIXES: {{^}}struct_type_t GlobalTypedefTestFunction(struct_type_t a_argument1) {
548     struct_type typedef_test_1;
549 // CHECK-FIXES: {{^}}    struct_type_t typedef_test_1;
550 }
551 
552 using my_struct_type = THIS___Structure;
553 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for type alias 'my_struct_type'
554 // CHECK-FIXES: {{^}}using my_Struct_Type_t = This_structure;{{$}}
555 
556 template<typename t_t>
557 using SomeOtherTemplate = my_other_templated_class  <:: FOO_NS  ::my_class>;
558 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for type alias 'SomeOtherTemplate'
559 // CHECK-FIXES: {{^}}using some_Other_Template_t = CMyOtherTemplatedClass  <:: foo_ns  ::CMyClass>;{{$}}
560 
561 static void static_Function() {
562 // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for function 'static_Function'
563 // CHECK-FIXES: {{^}}static void staticFunction() {{{$}}
564 
565   ::FOO_NS::InlineNamespace::abstract_class::CLASS_METHOD();
566 // CHECK-FIXES: {{^}}  ::foo_ns::inline_namespace::AAbstractClass::classMethod();{{$}}
567   ::FOO_NS::InlineNamespace::static_Function();
568 // CHECK-FIXES: {{^}}  ::foo_ns::inline_namespace::staticFunction();{{$}}
569 
570   using ::FOO_NS::InlineNamespace::CE_function;
571 // CHECK-FIXES: {{^}}  using ::foo_ns::inline_namespace::ce_function;{{$}}
572 
573   unsigned MY_LOCAL_array[] = {1,2,3};
574 // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for local variable 'MY_LOCAL_array'
575 // CHECK-FIXES: {{^}}  unsigned my_local_array[] = {1,2,3};{{$}}
576 
577   unsigned const MyConstLocal_array[] = {1,2,3};
578 // CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for local constant 'MyConstLocal_array'
579 // CHECK-FIXES: {{^}}  unsigned const kMyConstLocalArray[] = {1,2,3};{{$}}
580 
581   static unsigned MY_STATIC_array[] = {1,2,3};
582 // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: invalid case style for static variable 'MY_STATIC_array'
583 // CHECK-FIXES: {{^}}  static unsigned s_myStaticArray[] = {1,2,3};{{$}}
584 
585   static unsigned const MyConstStatic_array[] = {1,2,3};
586 // CHECK-MESSAGES: :[[@LINE-1]]:25: warning: invalid case style for static constant 'MyConstStatic_array'
587 // CHECK-FIXES: {{^}}  static unsigned const MY_CONST_STATIC_ARRAY[] = {1,2,3};{{$}}
588 
589   char MY_LOCAL_string[] = "123";
590 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for local variable 'MY_LOCAL_string'
591 // CHECK-FIXES: {{^}}  char my_local_string[] = "123";{{$}}
592 
593   char const MyConstLocal_string[] = "123";
594 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for local constant 'MyConstLocal_string'
595 // CHECK-FIXES: {{^}}  char const kMyConstLocalString[] = "123";{{$}}
596 
597   static char MY_STATIC_string[] = "123";
598 // CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for static variable 'MY_STATIC_string'
599 // CHECK-FIXES: {{^}}  static char s_myStaticString[] = "123";{{$}}
600 
601   static char const MyConstStatic_string[] = "123";
602 // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: invalid case style for static constant 'MyConstStatic_string'
603 // CHECK-FIXES: {{^}}  static char const MY_CONST_STATIC_STRING[] = "123";{{$}}
604 }
605 
606 #define MY_TEST_Macro(X) X()
607 // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for macro definition 'MY_TEST_Macro'
608 // CHECK-FIXES: {{^}}#define MY_TEST_MACRO(X) X()
609 
610 void MY_TEST_Macro(function) {}
611 // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for global function 'function' [readability-identifier-naming]
612 // CHECK-FIXES: {{^}}void MY_TEST_MACRO(Function) {}
613 
614 #define MY_CAT_IMPL(l, r) l ## r
615 #define MY_CAT(l, r) MY_CAT_IMPL(l, r)
616 #define MY_MACRO2(foo) int MY_CAT(awesome_, MY_CAT(foo, __COUNTER__)) = 0
617 #define MY_MACRO3(foo) int MY_CAT(awesome_, foo) = 0
618 MY_MACRO2(myglob);
619 MY_MACRO3(myglob);
620 // No suggestions should occur even though the resulting decl of awesome_myglob#
621 // or awesome_myglob are not entirely within a macro argument.
622 
623 } // namespace InlineNamespace
624 } // namespace FOO_NS
625 
626 template <typename t_t> struct a {
627 // CHECK-MESSAGES: :[[@LINE-1]]:32: warning: invalid case style for struct 'a'
628 // CHECK-FIXES: {{^}}template <typename t_t> struct A {{{$}}
629   typename t_t::template b<> c;
630 
631   char const MY_ConstMember_string[4] = "123";
632 // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for constant member 'MY_ConstMember_string'
633 // CHECK-FIXES: {{^}}  char const my_const_member_string[4] = "123";{{$}}
634 
635   static char const MyConstClass_string[];
636 // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: invalid case style for class constant 'MyConstClass_string'
637 // CHECK-FIXES: {{^}}  static char const kMyConstClassString[];{{$}}
638 };
639 
640 template<typename t_t>
641 char const a<t_t>::MyConstClass_string[] = "123";
642 // CHECK-FIXES: {{^}}char const A<t_t>::kMyConstClassString[] = "123";{{$}}
643 
644 template <template <typename> class A> struct b { A<int> c; };
645 // CHECK-MESSAGES: :[[@LINE-1]]:47: warning: invalid case style for struct 'b'
646 // CHECK-FIXES:template <template <typename> class A> struct B { A<int> c; };{{$}}
647 
648 unsigned MY_GLOBAL_array[] = {1,2,3};
649 // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: invalid case style for global variable 'MY_GLOBAL_array'
650 // CHECK-FIXES: {{^}}unsigned g_my_global_array[] = {1,2,3};{{$}}
651 
652 unsigned const MyConstGlobal_array[] = {1,2,3};
653 // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for global constant 'MyConstGlobal_array'
654 // CHECK-FIXES: {{^}}unsigned const MY_CONST_GLOBAL_ARRAY[] = {1,2,3};{{$}}
655 
656 int * MyGlobal_Ptr;// -> ok
657 int * my_second_global_Ptr;
658 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for global pointer 'my_second_global_Ptr'
659 // CHECK-FIXES: {{^}}int * MySecondGlobal_Ptr;{{$}}
660 int * const MyConstantGlobalPointer = nullptr;
661 // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for global constant pointer 'MyConstantGlobalPointer'
662 // CHECK-FIXES: {{^}}int * const MY_CONSTANT_GLOBAL_POINTER_Ptr = nullptr;{{$}}
663 
664 void MyPoiterFunction(int * p_normal_pointer, int * const constant_ptr){
665 // CHECK-MESSAGES: :[[@LINE-1]]:59: warning: invalid case style for constant pointer parameter 'constant_ptr'
666 // CHECK-FIXES: {{^}}void MyPoiterFunction(int * p_normal_pointer, int * const cp_ConstantPtr){{{$}}
667     int * l_PointerA;
668     int * const pointer_b = nullptr;
669 // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: invalid case style for local constant pointer 'pointer_b'
670 // CHECK-FIXES: {{^}}    int * const lc_PointerB = nullptr;{{$}}
671 }
672 
673 using namespace FOO_NS;
674 // CHECK-FIXES: {{^}}using namespace foo_ns;
675 
676 using namespace FOO_NS::InlineNamespace;
677 // CHECK-FIXES: {{^}}using namespace foo_ns::inline_namespace;
678 
679 void QualifiedTypeLocTest(THIS___Structure);
680 // CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure);{{$}}
681 void QualifiedTypeLocTest(THIS___Structure &);
682 // CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &);{{$}}
683 void QualifiedTypeLocTest(THIS___Structure &&);
684 // CHECK-FIXES: {{^}}void QualifiedTypeLocTest(This_structure &&);{{$}}
685 void QualifiedTypeLocTest(const THIS___Structure);
686 // CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure);{{$}}
687 void QualifiedTypeLocTest(const THIS___Structure &);
688 // CHECK-FIXES: {{^}}void QualifiedTypeLocTest(const This_structure &);{{$}}
689 void QualifiedTypeLocTest(volatile THIS___Structure &);
690 // CHECK-FIXES: {{^}}void QualifiedTypeLocTest(volatile This_structure &);{{$}}
691 
692 namespace redecls {
693 // We only want the warning to show up once here for the first decl.
694 // CHECK-MESSAGES: :[[@LINE+1]]:6: warning: invalid case style for global function 'badNamedFunction'
695 void badNamedFunction();
696 void badNamedFunction();
697 void badNamedFunction(){}
698 //      CHECK-FIXES: {{^}}void BadNamedFunction();
699 // CHECK-FIXES-NEXT: {{^}}void BadNamedFunction();
700 // CHECK-FIXES-NEXT: {{^}}void BadNamedFunction(){}
701 void ReferenceBadNamedFunction() {
702   auto l_Ptr = badNamedFunction;
703   // CHECK-FIXES: {{^}}  auto l_Ptr = BadNamedFunction;
704   l_Ptr();
705   badNamedFunction();
706   // CHECK-FIXES: {{^}}  BadNamedFunction();
707 }
708 
709 } // namespace redecls
710 
711 namespace scratchspace {
712 #define DUP(Tok) Tok
713 #define M1(Tok) DUP(badName##Tok())
714 
715 // We don't want a warning here as the call to this in Foo is in a scratch
716 // buffer so its fix-it wouldn't be applied, resulting in invalid code.
717 void badNameWarn();
718 
719 void Foo() {
720   M1(Warn);
721 }
722 
723 #undef M1
724 #undef DUP
725 } // namespace scratchspace
726 
727 template<typename type_t>
728 auto GetRes(type_t& Param) -> decltype(Param.res());
729 // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: invalid case style for parameter 'Param'
730 // CHECK-FIXES: auto GetRes(type_t& a_param) -> decltype(a_param.res());
731 
732 // Check implicit declarations in coroutines
733 
734 struct async_obj {
735 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'async_obj'
736 // CHECK-FIXES: {{^}}struct Async_obj {{{$}}
737 public:
738   never_suspend operator co_await() const noexcept;
739 };
740 
741 task ImplicitDeclTest(async_obj &a_object) {
742   co_await a_object;  // CHECK-MESSAGES-NOT: warning: invalid case style for local variable
743 }
744 
745 // Test scenario when canonical declaration will be a forward declaration
746 struct ForwardDeclStruct;
747 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for struct 'ForwardDeclStruct' [readability-identifier-naming]
748 // CHECK-FIXES: {{^}}struct Forward_decl_struct;
749 // CHECK-FIXES: {{^}}struct Forward_decl_struct {
750 struct ForwardDeclStruct {
751 };
752 
753 struct forward_declared_as_struct;
754 // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: invalid case style for class 'forward_declared_as_struct' [readability-identifier-naming]
755 // CHECK-FIXES: {{^}}struct CForwardDeclaredAsStruct;
756 // CHECK-FIXES: {{^}}class CForwardDeclaredAsStruct {
757 class forward_declared_as_struct {
758 };
759 
760 namespace pr55156 {
761 
762 template<typename> struct Wrap;
763 
764 typedef enum {
765   VALUE0,
766   VALUE1,
767 } ValueType;
768 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: invalid case style for typedef 'ValueType' [readability-identifier-naming]
769 // CHECK-FIXES: {{^}}} value_type_t;
770 
771 typedef ValueType (*MyFunPtr)(const ValueType&, Wrap<ValueType>*);
772 // CHECK-MESSAGES: :[[@LINE-1]]:21: warning: invalid case style for typedef 'MyFunPtr' [readability-identifier-naming]
773 // CHECK-FIXES: {{^}}typedef value_type_t (*my_fun_ptr_t)(const value_type_t&, Wrap<value_type_t>*);
774 
775 #define STATIC_MACRO static
776 STATIC_MACRO void someFunc(ValueType a_v1, const ValueType& a_v2) {}
777 // CHECK-FIXES: {{^}}STATIC_MACRO void someFunc(value_type_t a_v1, const value_type_t& a_v2) {}
778 STATIC_MACRO void someFunc(const ValueType** p_a_v1, ValueType (*p_a_v2)()) {}
779 // CHECK-FIXES: {{^}}STATIC_MACRO void someFunc(const value_type_t** p_a_v1, value_type_t (*p_a_v2)()) {}
780 STATIC_MACRO ValueType someFunc() {}
781 // CHECK-FIXES: {{^}}STATIC_MACRO value_type_t someFunc() {}
782 STATIC_MACRO void someFunc(MyFunPtr, const MyFunPtr****) {}
783 // CHECK-FIXES: {{^}}STATIC_MACRO void someFunc(my_fun_ptr_t, const my_fun_ptr_t****) {}
784 #undef STATIC_MACRO
785 }
786 
787 struct Some_struct {
788   int SomeMember;
789 // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for public member 'SomeMember' [readability-identifier-naming]
790 // CHECK-FIXES: {{^}}  int some_member;
791 };
792 Some_struct g_s1{ .SomeMember = 1 };
793 // CHECK-FIXES: {{^}}Some_struct g_s1{ .some_member = 1 };
794 Some_struct g_s2{.SomeMember=1};
795 // CHECK-FIXES: {{^}}Some_struct g_s2{.some_member=1};
796