Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / third_party / nlfaultinjection / repo / third_party / cstyle / repo / tests / implicit-void-declaration.cpp
1 #include <stdint.h>
2
3 // Positive tests: tests that should trigger a violation
4
5 // Void return type
6
7 // Spaces w/o extern
8 void free_function_test_1();
9 void free_function_test_2 ();
10 void  free_function_test_3();
11 void   free_function_test_4  ();
12 void free_function_test_5 () ;
13 void  free_function_test_6() ;
14 void   free_function_test_7  ()  ;
15
16 // Tabs w/o extern
17 void    free_function_test_8();
18 void    free_function_test_9    ();
19 void            free_function_test_10();
20 void                    free_function_test_11           ();
21 void    free_function_test_12   ()      ;
22 void            free_function_test_13() ;
23 void                    free_function_test_14           ()              ;
24
25 // Spaces w/ extern
26 extern void free_function_test_15();
27 extern void free_function_test_16 ();
28 extern void  free_function_test_17();
29 extern void   free_function_test_18  ();
30 extern void free_function_test_19 () ;
31 extern void  free_function_test_20() ;
32 extern void   free_function_test_21  ()  ;
33
34 // Tabs w/ extern
35 extern  void    free_function_test_22();
36 extern  void    free_function_test_23   ();
37 extern  void            free_function_test_24();
38 extern  void                    free_function_test_25           ();
39 extern  void    free_function_test_26   ()      ;
40 extern  void            free_function_test_27() ;
41 extern  void                    free_function_test_28           ()              ;
42
43 // Spaces w/ static
44 static void free_function_test_29();
45 static void free_function_test_30 ();
46 static void  free_function_test_31();
47 static void   free_function_test_32  ();
48 static void free_function_test_33 () ;
49 static void  free_function_test_34() ;
50 static void   free_function_test_35  ()  ;
51
52 // Tabs w/ static
53 static  void    free_function_test_36();
54 static  void    free_function_test_37   ();
55 static  void            free_function_test_38();
56 static  void                    free_function_test_39           ();
57 static  void    free_function_test_40   ()      ;
58 static  void            free_function_test_41() ;
59 static  void                    free_function_test_42           ()              ;
60
61 // Const char * return type
62
63 // Spaces w/o extern
64 const char * free_function_test_43();
65 const char * free_function_test_44 ();
66 const char *  free_function_test_45();
67 const char *   free_function_test_46  ();
68 const char * free_function_test_47 () ;
69 const char *  free_function_test_48() ;
70 const char *   free_function_test_49  ()  ;
71
72 // Tabs w/o extern
73 const char *    free_function_test_50();
74 const char *    free_function_test_51   ();
75 const char *            free_function_test_52();
76 const char *                    free_function_test_53           ();
77 const char *    free_function_test_54   ()      ;
78 const char *            free_function_test_55() ;
79 const char *                    free_function_test_56           ()              ;
80
81 // Spaces w/ extern
82 extern const char * free_function_test_57();
83 extern const char * free_function_test_58 ();
84 extern const char *  free_function_test_59();
85 extern const char *   free_function_test_60  ();
86 extern const char * free_function_test_61 () ;
87 extern const char *  free_function_test_62() ;
88 extern const char *   free_function_test_63  ()  ;
89
90 // Tabs w/ extern
91 extern  const char *    free_function_test_64();
92 extern  const char *    free_function_test_65   ();
93 extern  const char *            free_function_test_66();
94 extern  const char *                    free_function_test_67           ();
95 extern  const char *    free_function_test_68   ()      ;
96 extern  const char *            free_function_test_69() ;
97 extern  const char *                    free_function_test_70           ()              ;
98
99 // Spaces w/ static
100 static const char * free_function_test_71();
101 static const char * free_function_test_72 ();
102 static const char *  free_function_test_73();
103 static const char *   free_function_test_74  ();
104 static const char * free_function_test_75 () ;
105 static const char *  free_function_test_76() ;
106 static const char *   free_function_test_77  ()  ;
107
108 // Tabs w/ static
109 static  const char *    free_function_test_78();
110 static  const char *    free_function_test_79   ();
111 static  const char *            free_function_test_80();
112 static  const char *                    free_function_test_81           ();
113 static  const char *    free_function_test_82   ()      ;
114 static  const char *            free_function_test_83() ;
115 static  const char *                    free_function_test_84           ()              ;
116
117 // Const uint32_t & return type
118
119 // Spaces w/o extern
120 const uint32_t & free_function_test_85();
121 const uint32_t & free_function_test_86 ();
122 const uint32_t &  free_function_test_87();
123 const uint32_t &   free_function_test_88  ();
124 const uint32_t & free_function_test_89 () ;
125 const uint32_t &  free_function_test_90() ;
126 const uint32_t &   free_function_test_91  ()  ;
127
128 // Tabs w/o extern
129 const uint32_t &        free_function_test_92();
130 const uint32_t &        free_function_test_93   ();
131 const uint32_t &                free_function_test_94();
132 const uint32_t &                        free_function_test_95           ();
133 const uint32_t &        free_function_test_96   ()      ;
134 const uint32_t &                free_function_test_97() ;
135 const uint32_t &                        free_function_test_98           ()              ;
136
137 // Spaces w/ extern
138 extern const uint32_t & free_function_test_99();
139 extern const uint32_t & free_function_test_100 ();
140 extern const uint32_t &  free_function_test_101();
141 extern const uint32_t &   free_function_test_102  ();
142 extern const uint32_t & free_function_test_103 () ;
143 extern const uint32_t &  free_function_test_104() ;
144 extern const uint32_t &   free_function_test_105  ()  ;
145
146 // Tabs w/ extern
147 extern  const uint32_t &        free_function_test_106();
148 extern  const uint32_t &        free_function_test_107  ();
149 extern  const uint32_t &                free_function_test_108();
150 extern  const uint32_t &                        free_function_test_109          ();
151 extern  const uint32_t &        free_function_test_110  ()      ;
152 extern  const uint32_t &                free_function_test_111()        ;
153 extern  const uint32_t &                        free_function_test_112          ()              ;
154
155 // Spaces w/ static
156 static const uint32_t & free_function_test_113();
157 static const uint32_t & free_function_test_114 ();
158 static const uint32_t &  free_function_test_115();
159 static const uint32_t &   free_function_test_116  ();
160 static const uint32_t & free_function_test_117 () ;
161 static const uint32_t &  free_function_test_118() ;
162 static const uint32_t &   free_function_test_119  ()  ;
163
164 // Tabs w/ static
165 static  const uint32_t &        free_function_test_120();
166 static  const uint32_t &        free_function_test_121  ();
167 static  const uint32_t &                free_function_test_122();
168 static  const uint32_t &                        free_function_test_123          ();
169 static  const uint32_t &        free_function_test_124  ()      ;
170 static  const uint32_t &                free_function_test_125()        ;
171 static  const uint32_t &                        free_function_test_126          ()              ;
172
173 // Void return type
174
175 class test
176 {
177     // Spaces w/o qualifiers
178     void method_test_1();
179     void method_test_2 ();
180     void  method_test_3();
181     void   method_test_4  ();
182     void method_test_5 () ;
183     void  method_test_6() ;
184     void   method_test_7  ()  ;
185
186     // Tabs w/o qualifiers
187     void        method_test_8();
188     void        method_test_9   ();
189     void                method_test_10();
190     void                        method_test_11          ();
191     void        method_test_12  ()      ;
192     void                method_test_13()        ;
193     void                        method_test_14          ()              ;
194
195     // Spaces w/ const qualifier
196     void method_test_15() const;
197     void method_test_16 () const;
198     void  method_test_17() const;
199     void   method_test_18  () const;
200     void method_test_19 ()  const;
201     void  method_test_20()  const;
202     void   method_test_21  ()   const;
203
204     // Tabs w/ const qualifier
205     void        method_test_22()        const;
206     void        method_test_23  ()      const;
207     void                method_test_24()        const;
208     void                        method_test_25          ()      const;
209     void        method_test_26  ()      const   ;
210     void                method_test_27()        const   ;
211     void                        method_test_28          ()              const           ;
212
213     // Spaces w/ volatile qualifier
214     void method_test_29() volatile;
215     void method_test_30 () volatile;
216     void  method_test_31() volatile;
217     void   method_test_32  () volatile;
218     void method_test_33 ()  volatile;
219     void  method_test_34()  volatile;
220     void   method_test_35  ()   volatile;
221
222     // Tabs w/ volatile qualifier
223     void        method_test_36()        volatile;
224     void        method_test_37  ()      volatile;
225     void                method_test_38()        volatile;
226     void                        method_test_39          ()      volatile;
227     void        method_test_40  ()      volatile        ;
228     void                method_test_41()        volatile        ;
229     void                        method_test_42          ()              volatile                ;
230
231     // Spaces w/ const and volatile qualifiers
232     void method_test_43() const volatile;
233     void method_test_44 () const volatile;
234     void  method_test_45() const volatile;
235     void   method_test_46  () const volatile;
236     void method_test_47 ()  const volatile;
237     void  method_test_48()  const volatile;
238     void   method_test_49  ()   const volatile;
239
240     // Tabs w/ const and volatile qualifiers
241     void        method_test_50()        const volatile;
242     void        method_test_51  ()      const volatile;
243     void                method_test_52()        const volatile;
244     void                        method_test_53          ()      const volatile;
245     void        method_test_54  ()      const volatile  ;
246     void                method_test_55()        const volatile  ;
247     void                        method_test_56          ()              const volatile          ;
248
249     // Static
250
251     // Spaces w/o qualifiers
252     static void method_test_57();
253     static void method_test_58 ();
254     static void  method_test_59();
255     static void   method_test_60  ();
256     static void method_test_61 () ;
257     static void  method_test_62() ;
258     static void   method_test_63  ()  ;
259
260     // Tabs w/o qualifiers
261     static void method_test_64();
262     static void method_test_65  ();
263     static void         method_test_66();
264     static void                 method_test_67          ();
265     static void method_test_68  ()      ;
266     static void         method_test_69()        ;
267     static void                 method_test_70          ()              ;
268
269     // Virtual
270
271     // Spaces w/o qualifiers
272     virtual void method_test_113();
273     virtual void method_test_114 ();
274     virtual void  method_test_115();
275     virtual void   method_test_116  ();
276     virtual void method_test_117 () ;
277     virtual void  method_test_118() ;
278     virtual void   method_test_119  ()  ;
279
280     // Tabs w/o qualifiers
281     virtual void        method_test_120();
282     virtual void        method_test_121 ();
283     virtual void                method_test_122();
284     virtual void                        method_test_123         ();
285     virtual void        method_test_124 ()      ;
286     virtual void                method_test_125()       ;
287     virtual void                        method_test_126         ()              ;
288
289     // Spaces w/ const qualifier
290     virtual void method_test_127() const;
291     virtual void method_test_128 () const;
292     virtual void  method_test_129() const;
293     virtual void   method_test_130  () const;
294     virtual void method_test_131 ()  const;
295     virtual void  method_test_132()  const;
296     virtual void   method_test_133  ()   const;
297
298     // Tabs w/ const qualifier
299     virtual void        method_test_134()       const;
300     virtual void        method_test_135 ()      const;
301     virtual void                method_test_136()       const;
302     virtual void                        method_test_137         ()      const;
303     virtual void        method_test_138 ()      const   ;
304     virtual void                method_test_139()       const   ;
305     virtual void                        method_test_140         ()              const           ;
306
307     // Spaces w/ volatile qualifier
308     virtual void method_test_141() volatile;
309     virtual void method_test_142 () volatile;
310     virtual void  method_test_143() volatile;
311     virtual void   method_test_144  () volatile;
312     virtual void method_test_145 ()  volatile;
313     virtual void  method_test_146()  volatile;
314     virtual void   method_test_147  ()   volatile;
315
316     // Tabs w/ volatile qualifier
317     virtual void        method_test_148()       volatile;
318     virtual void        method_test_149 ()      volatile;
319     virtual void                method_test_150()       volatile;
320     virtual void                        method_test_151         ()      volatile;
321     virtual void        method_test_152 ()      volatile        ;
322     virtual void                method_test_153()       volatile        ;
323     virtual void                        method_test_154         ()              volatile                ;
324
325     // Spaces w/ const and volatile qualifiers
326     virtual void method_test_155() const volatile;
327     virtual void method_test_156 () const volatile;
328     virtual void  method_test_157() const volatile;
329     virtual void   method_test_158  () const volatile;
330     virtual void method_test_159 ()  const volatile;
331     virtual void  method_test_160()  const volatile;
332     virtual void   method_test_161  ()   const volatile;
333
334     // Tabs w/ const and volatile qualifiers
335     virtual void        method_test_162()       const volatile;
336     virtual void        method_test_163 ()      const volatile;
337     virtual void                method_test_164()       const volatile;
338     virtual void                        method_test_165         ()      const volatile;
339     virtual void        method_test_166 ()      const volatile  ;
340     virtual void                method_test_167()       const volatile  ;
341     virtual void                        method_test_168         ()              const volatile          ;
342
343     // Pure virtual
344
345     // Spaces w/o qualifiers
346     virtual void method_test_169() = 0;
347     virtual void method_test_170 () = 0;
348     virtual void  method_test_171() = 0;
349     virtual void   method_test_172  () = 0;
350     virtual void method_test_173 ()  = 0;
351     virtual void  method_test_174()  = 0;
352     virtual void   method_test_175  ()   = 0;
353
354     // Tabs w/o qualifiers
355     virtual void        method_test_176() = 0;
356     virtual void        method_test_177 () = 0;
357     virtual void                method_test_178() = 0;
358     virtual void                        method_test_179         () = 0;
359     virtual void        method_test_180 ()       = 0;
360     virtual void                method_test_181()        = 0;
361     virtual void                        method_test_182         ()               = 0;
362
363     // Spaces w/ const qualifier
364     virtual void method_test_183() const = 0;
365     virtual void method_test_184 () const = 0;
366     virtual void  method_test_185() const = 0;
367     virtual void   method_test_186  () const = 0;
368     virtual void method_test_187 ()  const = 0;
369     virtual void  method_test_188()  const = 0;
370     virtual void   method_test_189  ()   const = 0;
371
372     // Tabs w/ const qualifier
373     virtual void        method_test_190()       const = 0;
374     virtual void        method_test_191 ()      const = 0;
375     virtual void                method_test_192()       const = 0;
376     virtual void                        method_test_193         ()      const = 0;
377     virtual void        method_test_194 ()      const    = 0;
378     virtual void                method_test_195()       const    = 0;
379     virtual void                        method_test_196         ()              const            = 0;
380
381     // Spaces w/ volatile qualifier
382     virtual void method_test_197() volatile = 0;
383     virtual void method_test_198 () volatile = 0;
384     virtual void  method_test_199() volatile = 0;
385     virtual void   method_test_200  () volatile = 0;
386     virtual void method_test_201 ()  volatile = 0;
387     virtual void  method_test_202()  volatile = 0;
388     virtual void   method_test_203  ()   volatile = 0;
389
390     // Tabs w/ volatile qualifier
391     virtual void        method_test_204()       volatile = 0;
392     virtual void        method_test_205 ()      volatile = 0;
393     virtual void                method_test_206()       volatile = 0;
394     virtual void                        method_test_207         ()      volatile = 0;
395     virtual void        method_test_208 ()      volatile         = 0;
396     virtual void                method_test_209()       volatile         = 0;
397     virtual void                        method_test_210         ()              volatile                 = 0;
398
399     // Spaces w/ const and volatile qualifiers
400     virtual void method_test_211() const volatile = 0;
401     virtual void method_test_212 () const volatile = 0;
402     virtual void  method_test_213() const volatile = 0;
403     virtual void   method_test_214  () const volatile = 0;
404     virtual void method_test_215 ()  const volatile = 0;
405     virtual void  method_test_216()  const volatile = 0;
406     virtual void   method_test_217  ()   const volatile = 0;
407
408     // Tabs w/ const and volatile qualifiers
409     virtual void        method_test_218()       const volatile = 0;
410     virtual void        method_test_219 ()      const volatile = 0;
411     virtual void                method_test_220()       const volatile = 0;
412     virtual void                        method_test_221         ()      const volatile = 0;
413     virtual void        method_test_222 ()      const volatile   = 0;
414     virtual void                method_test_223()       const volatile   = 0;
415     virtual void                        method_test_224         ()              const volatile           = 0;
416 };
417
418 // Negative tests: tests that should not trigger a violation
419
420 class negative_test_1
421 {
422 public:
423     void void_method(void);
424     static int int_method_1(void);
425     int int_method_2(void);
426 };
427
428 class negative_test_2
429 {
430 public:
431     inline void void_method(void)
432     {
433         m_negative_test_1_pointer->void_method();
434         m_negative_test_1_reference.void_method();
435     }
436
437     inline int int_method_1(void)
438     {
439         return negative_test_1::int_method_1();
440     }
441
442     inline int int_method_2(void)
443     {
444         int retval;
445
446         retval = m_negative_test_1_reference.int_method_2();
447
448         return retval;
449     }
450
451 private:
452     negative_test_1 *m_negative_test_1_pointer;
453     negative_test_1 &m_negative_test_1_reference;
454
455 };