1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s
2 
3 // This file contains lots of corner cases, so ensure that XML we generate is not invalid.
4 // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng %s | FileCheck %s -check-prefix=WRONG
5 // WRONG-NOT: CommentXMLInvalid
6 
7 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
8 // expected-warning@+1 {{expected quoted string after equals sign}}
9 /// <a href=>
10 int test_html1(int);
11 
12 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
13 // expected-warning@+1 {{expected quoted string after equals sign}}
14 /// <a href==>
15 int test_html2(int);
16 
17 // expected-warning@+3 {{HTML tag 'a' requires an end tag}}
18 // expected-warning@+2 {{expected quoted string after equals sign}}
19 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
20 /// <a href= blah
21 int test_html3(int);
22 
23 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
24 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
25 /// <a =>
26 int test_html4(int);
27 
28 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
29 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
30 /// <a "aaa">
31 int test_html5(int);
32 
33 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
34 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
35 /// <a a="b" =>
36 int test_html6(int);
37 
38 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
39 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
40 /// <a a="b" "aaa">
41 int test_html7(int);
42 
43 // expected-warning@+2 {{HTML tag 'a' requires an end tag}}
44 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
45 /// <a a="b" =
46 int test_html8(int);
47 
48 // expected-warning@+2 {{HTML start tag prematurely ended, expected attribute name or '>'}} expected-note@+1 {{HTML tag started here}}
49 /** Aaa bbb<img ddd eee
50  * fff ggg.
51  */
52 int test_html9(int);
53 
54 // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
55 /** Aaa bbb<img ddd eee 42%
56  * fff ggg.
57  */
58 int test_html10(int);
59 
60 // expected-warning@+1 {{HTML end tag 'br' is forbidden}}
61 /// <br></br>
62 int test_html11(int);
63 
64 /// <blockquote>Meow</blockquote>
65 int test_html_nesting1(int);
66 
67 /// <b><i>Meow</i></b>
68 int test_html_nesting2(int);
69 
70 /// <p>Aaa<br>
71 /// Bbb</p>
72 int test_html_nesting3(int);
73 
74 /// <p>Aaa<br />
75 /// Bbb</p>
76 int test_html_nesting4(int);
77 
78 // expected-warning@+3 {{HTML tag 'b' requires an end tag}}
79 // expected-warning@+2 {{HTML tag 'i' requires an end tag}}
80 // expected-warning@+1 {{HTML end tag does not match any start tag}}
81 /// <b><i>Meow</a>
82 int test_html_nesting5(int);
83 
84 // expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
85 // expected-warning@+1 {{HTML end tag does not match any start tag}}
86 /// <b><i>Meow</b></b>
87 int test_html_nesting6(int);
88 
89 // expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
90 // expected-warning@+1 {{HTML end tag does not match any start tag}}
91 /// <b><i>Meow</b></i>
92 int test_html_nesting7(int);
93 
94 // expected-warning@+1 {{HTML tag 'b' requires an end tag}}
95 /// <b>Meow
96 int test_html_nesting8(int);
97 
98 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
99 /// \brief\returns Aaa
100 int test_block_command1(int);
101 
102 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
103 /// \brief \returns Aaa
104 int test_block_command2(int);
105 
106 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
107 /// \brief
108 /// \returns Aaa
109 int test_block_command3(int);
110 
111 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
112 /// \brief
113 ///
114 /// \returns Aaa
115 int test_block_command4(int);
116 
117 // There is trailing whitespace on one of the following lines, don't remove it!
118 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
119 /// \brief
120 ///
121 /// \returns Aaa
122 int test_block_command5(int);
123 
124 /// \brief \c Aaa
125 int test_block_command6(int);
126 
127 // expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\brief' here}}
128 /// \brief Aaa
129 ///
130 /// Bbb
131 ///
132 /// \brief Ccc
133 int test_duplicate_brief1(int);
134 
135 // expected-warning@+5 {{duplicated command '\short'}} expected-note@+1 {{previous command '\short' here}}
136 /// \short Aaa
137 ///
138 /// Bbb
139 ///
140 /// \short Ccc
141 int test_duplicate_brief2(int);
142 
143 // expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\short' (an alias of '\brief') here}}
144 /// \short Aaa
145 ///
146 /// Bbb
147 ///
148 /// \brief Ccc
149 int test_duplicate_brief3(int);
150 
151 
152 /// \return Aaa
153 ///
154 /// Bbb
155 ///
156 /// \return Ccc
157 int test_multiple_returns1(int);
158 
159 /// \returns Aaa
160 ///
161 /// Bbb
162 ///
163 /// \returns Ccc
164 int test_multiple_returns2(int);
165 
166 /// \result Aaa
167 ///
168 /// Bbb
169 ///
170 /// \result Ccc
171 int test_multiple_returns3(int);
172 
173 /// \returns Aaa
174 ///
175 /// Bbb
176 ///
177 /// \return Ccc
178 int test_multiple_returns4(int);
179 
180 
181 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
182 /// \param a Blah blah.
183 int test_param1_backslash;
184 
185 // rdar://13066276
186 // Check that the diagnostic uses the same command marker as the comment.
187 // expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}
188 /// @param a Blah blah.
189 int test_param1_at;
190 
191 // expected-warning@+1 {{empty paragraph passed to '\param' command}}
192 /// \param
193 /// \param a Blah blah.
194 int test_param2(int a);
195 
196 // expected-warning@+1 {{empty paragraph passed to '\param' command}}
197 /// \param a
198 int test_param3(int a);
199 
200 /// \param a Blah blah.
201 int test_param4(int a);
202 
203 /// \param [in] a Blah blah.
204 int test_param5(int a);
205 
206 /// \param [out] a Blah blah.
207 int test_param6(int a);
208 
209 /// \param [in,out] a Blah blah.
210 int test_param7(int a);
211 
212 // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
213 /// \param [ in ] a Blah blah.
214 int test_param8(int a);
215 
216 // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
217 /// \param [in, out] a Blah blah.
218 int test_param9(int a);
219 
220 // expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}}
221 /// \param [ junk] a Blah blah.
222 int test_param10(int a);
223 
224 // expected-warning@+1 {{parameter 'a' not found in the function declaration}}
225 /// \param a Blah blah.
226 int test_param11();
227 
228 // expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
229 /// \param A Blah blah.
230 int test_param12(int a);
231 
232 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
233 /// \param aab Blah blah.
234 int test_param13(int aaa, int bbb);
235 
236 // expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'bbb'?}}
237 /// \param aaa Blah blah.
238 /// \param aab Blah blah.
239 int test_param14(int aaa, int bbb);
240 
241 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
242 /// \param aab Blah blah.
243 int test_param15(int bbb, int ccc);
244 
245 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
246 /// \param aab Ccc.
247 /// \param aaa Aaa.
248 /// \param bbb Bbb.
249 int test_param16(int aaa, int bbb);
250 
251 // expected-warning@+2 {{parameter 'aab' not found in the function declaration}}
252 /// \param aaa Aaa.
253 /// \param aab Ccc.
254 /// \param bbb Bbb.
255 int test_param17(int aaa, int bbb);
256 
257 // expected-warning@+3 {{parameter 'aab' not found in the function declaration}}
258 /// \param aaa Aaa.
259 /// \param bbb Bbb.
260 /// \param aab Ccc.
261 int test_param18(int aaa, int bbb);
262 
263 class C {
264   // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
265   /// \param aaa Blah blah.
266   C(int bbb, int ccc);
267 
268   // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
269   /// \param aaa Blah blah.
270  int test_param19(int bbb, int ccc);
271 };
272 
273 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
274 /// \param aab Blah blah.
275 template<typename T>
276 void test_param20(int bbb, int ccc);
277 
278 // expected-warning@+3 {{parameter 'a' is already documented}}
279 // expected-note@+1 {{previous documentation}}
280 /// \param a Aaa.
281 /// \param a Aaa.
282 int test_param21(int a);
283 
284 // expected-warning@+4 {{parameter 'x2' is already documented}}
285 // expected-note@+2 {{previous documentation}}
286 /// \param x1 Aaa.
287 /// \param x2 Bbb.
288 /// \param x2 Ccc.
289 int test_param22(int x1, int x2, int x3);
290 
291 // expected-warning@+1 {{empty paragraph passed to '\param' command}}
292 /// \param a
293 /// \retval 0 Blah blah.
294 int test_param23(int a);
295 
296 //===---
297 // Test that we treat typedefs to some non-function types as functions for the
298 // purposes of documentation comment parsing.
299 //===---
300 
301 namespace foo {
302   inline namespace bar {
303     template<typename>
304     struct function_wrapper {};
305 
306     template<unsigned>
307     struct not_a_function_wrapper {};
308   }
309 };
310 
311 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
312 /// \param aaa Meow.
313 /// \param bbb Bbb.
314 /// \returns aaa.
315 typedef int test_function_like_typedef1(int aaa, int ccc);
316 
317 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
318 /// \param aaa Meow.
319 /// \param bbb Bbb.
320 /// \returns aaa.
321 typedef int (*test_function_like_typedef2)(int aaa, int ccc);
322 
323 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
324 /// \param aaa Meow.
325 /// \param bbb Bbb.
326 /// \returns aaa.
327 typedef int (* const test_function_like_typedef3)(int aaa, int ccc);
328 
329 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
330 /// \param aaa Meow.
331 /// \param bbb Bbb.
332 /// \returns aaa.
333 typedef int (C::*test_function_like_typedef4)(int aaa, int ccc);
334 
335 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
336 /// \param aaa Meow.
337 /// \param bbb Bbb.
338 /// \returns aaa.
339 typedef foo::function_wrapper<int (int aaa, int ccc)> test_function_like_typedef5;
340 
341 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
342 /// \param aaa Meow.
343 /// \param bbb Bbb.
344 /// \returns aaa.
345 typedef foo::function_wrapper<int (int aaa, int ccc)> *test_function_like_typedef6;
346 
347 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
348 /// \param aaa Meow.
349 /// \param bbb Bbb.
350 /// \returns aaa.
351 typedef foo::function_wrapper<int (int aaa, int ccc)> &test_function_like_typedef7;
352 
353 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
354 /// \param aaa Meow.
355 /// \param bbb Bbb.
356 /// \returns aaa.
357 typedef foo::function_wrapper<int (int aaa, int ccc)> &&test_function_like_typedef8;
358 
359 
360 typedef int (*test_not_function_like_typedef1)(int aaa);
361 
362 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
363 /// \param aaa Meow.
364 typedef test_not_function_like_typedef1 test_not_function_like_typedef2;
365 
366 // rdar://13066276
367 // Check that the diagnostic uses the same command marker as the comment.
368 // expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}
369 /// @param aaa Meow.
370 typedef unsigned int test_not_function_like_typedef3;
371 
372 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
373 /// \param aaa Meow.
374 typedef foo::not_a_function_wrapper<1> test_not_function_like_typedef4;
375 
376 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
377 /// \param aaa Meow.
378 /// \param bbb Bbb.
379 /// \returns aaa.
380 using test_function_like_using1 = int (int aaa, int ccc);
381 
382 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
383 /// \param aaa Meow.
384 /// \param bbb Bbb.
385 /// \returns aaa.
386 using test_function_like_using2 = int (*)(int aaa, int ccc);
387 
388 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
389 /// \param aaa Meow.
390 /// \param bbb Bbb.
391 /// \returns aaa.
392 using test_function_like_using3 = int (* const)(int aaa, int ccc);
393 
394 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
395 /// \param aaa Meow.
396 /// \param bbb Bbb.
397 /// \returns aaa.
398 using test_function_like_using4 = int (C::*)(int aaa, int ccc);
399 
400 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
401 /// \param aaa Meow.
402 /// \param bbb Bbb.
403 /// \returns aaa.
404 using test_function_like_using5 = foo::function_wrapper<int (int aaa, int ccc)>;
405 
406 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
407 /// \param aaa Meow.
408 /// \param bbb Bbb.
409 /// \returns aaa.
410 using test_function_like_using6 = foo::function_wrapper<int (int aaa, int ccc)> *;
411 
412 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
413 /// \param aaa Meow.
414 /// \param bbb Bbb.
415 /// \returns aaa.
416 using test_function_like_using7 = foo::function_wrapper<int (int aaa, int ccc)> &;
417 
418 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
419 /// \param aaa Meow.
420 /// \param bbb Bbb.
421 /// \returns aaa.
422 using test_function_like_using8 = foo::function_wrapper<int (int aaa, int ccc)> &&;
423 
424 // expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}
425 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
426 /// \param aaa Meow.
427 /// \param bbb Bbb.
428 /// \tparam U Uuu.
429 template<typename T>
430 using test_function_like_using9 = int(T aaa, int ccc);
431 
432 // expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}
433 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
434 /// \param aaa Meow.
435 /// \param bbb Bbb.
436 /// \tparam U Uuu.
437 template<typename T>
438 using test_function_like_using10 = int (*)(T aaa, int ccc);
439 
440 // expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}
441 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
442 /// \param aaa Meow.
443 /// \param bbb Bbb.
444 /// \tparam U Uuu.
445 template<typename T>
446 using test_function_like_using11 = foo::function_wrapper<int (T aaa, int ccc)>;
447 
448 // expected-warning@+4 {{template parameter 'U' not found in the template declaration}} expected-note@+4 {{did you mean 'T'?}}
449 // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
450 /// \param aaa Meow.
451 /// \param bbb Bbb.
452 /// \tparam U Uuu.
453 template<typename T>
454 using test_function_like_using12 = foo::function_wrapper<int (T aaa, int ccc)> *;
455 
456 using test_not_function_like_using1 = int (*)(int aaa);
457 
458 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
459 /// \param aaa Meow.
460 using test_not_function_like_using2 = test_not_function_like_using1;
461 
462 // Check that the diagnostic uses the same command marker as the comment.
463 // expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}
464 /// @param aaa Meow.
465 using test_not_function_like_using3 = unsigned int;
466 
467 // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
468 /// \param aaa Meow.
469 using test_not_function_like_using4 = foo::not_a_function_wrapper<1>;
470 
471 /// \param aaa Aaa
472 /// \param ... Vararg
473 int test_vararg_param1(int aaa, ...);
474 
475 /// \param ... Vararg
476 int test_vararg_param2(...);
477 
478 // expected-warning@+1 {{parameter '...' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
479 /// \param ... Vararg
480 int test_vararg_param3(int aaa);
481 
482 // expected-warning@+1 {{parameter '...' not found in the function declaration}}
483 /// \param ... Vararg
484 int test_vararg_param4();
485 
486 
487 /// \param aaa Aaa
488 /// \param ... Vararg
489 template<typename T>
490 int test_template_vararg_param1(int aaa, ...);
491 
492 /// \param ... Vararg
493 template<typename T>
494 int test_template_vararg_param2(...);
495 
496 // expected-warning@+1 {{parameter '...' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
497 /// \param ... Vararg
498 template<typename T>
499 int test_template_vararg_param3(int aaa);
500 
501 // expected-warning@+1 {{parameter '...' not found in the function declaration}}
502 /// \param ... Vararg
503 template<typename T>
504 int test_template_vararg_param4();
505 
506 
507 // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
508 /// \tparam T Aaa
509 int test_tparam1;
510 
511 // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
512 /// \tparam T Aaa
513 void test_tparam2(int aaa);
514 
515 // expected-warning@+1 {{empty paragraph passed to '\tparam' command}}
516 /// \tparam
517 /// \param aaa Blah blah
518 template<typename T>
519 void test_tparam3(T aaa);
520 
521 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
522 /// \tparam T Aaa
523 template<typename TT>
524 void test_tparam4(TT aaa);
525 
526 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
527 /// \tparam T Aaa
528 template<typename TT>
529 class test_tparam5 {
530   // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}}
531   /// \tparam T Aaa
532   template<typename TTT>
533   void test_tparam6(TTT aaa);
534 };
535 
536 /// \tparam T1 Aaa
537 /// \tparam T2 Bbb
538 template<typename T1, typename T2>
539 void test_tparam7(T1 aaa, T2 bbb);
540 
541 // expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}
542 /// \tparam SomTy Aaa
543 /// \tparam OtherTy Bbb
544 template<typename SomeTy, typename OtherTy>
545 void test_tparam8(SomeTy aaa, OtherTy bbb);
546 
547 // expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}}
548 /// \tparam T1 Aaa
549 /// \tparam T1 Bbb
550 template<typename T1, typename T2>
551 void test_tparam9(T1 aaa, T2 bbb);
552 
553 /// \tparam T Aaa
554 /// \tparam TT Bbb
555 template<template<typename T> class TT>
556 void test_tparam10(TT<int> aaa);
557 
558 /// \tparam T Aaa
559 /// \tparam TT Bbb
560 /// \tparam TTT Ccc
561 template<template<template<typename T> class TT, class C> class TTT>
562 void test_tparam11();
563 
564 /// \tparam I Aaa
565 template<int I>
566 void test_tparam12();
567 
568 template<typename T, typename U>
569 class test_tparam13 { };
570 
571 /// \tparam T Aaa
572 template<typename T>
573 using test_tparam14 = test_tparam13<T, int>;
574 
575 // expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
576 /// \tparam U Aaa
577 template<typename T>
578 using test_tparam15 = test_tparam13<T, int>;
579 
580 // ----
581 
582 /// \tparam T Aaa
583 template<typename T>
584 class test_tparam16 { };
585 
586 typedef test_tparam16<int> test_tparam17;
587 typedef test_tparam16<double> test_tparam18;
588 
589 // ----
590 
591 template<typename T>
592 class test_tparam19;
593 
594 typedef test_tparam19<int> test_tparam20;
595 typedef test_tparam19<double> test_tparam21;
596 
597 /// \tparam T Aaa
598 template<typename T>
599 class test_tparam19 { };
600 
601 // ----
602 
603 // expected-warning@+1 {{'@tparam' command used in a comment that is not attached to a template declaration}}
604 /// @tparam T Aaa
605 int test_tparam22;
606 
607 // ----
608 
609 
610 /// Aaa
611 /// \deprecated Bbb
612 void test_deprecated_1(int a) __attribute__((deprecated));
613 
614 // We don't want \deprecated to warn about empty paragraph.  It is fine to use
615 // \deprecated by itself without explanations.
616 
617 /// Aaa
618 /// \deprecated
619 void test_deprecated_2(int a) __attribute__((deprecated));
620 
621 /// Aaa
622 /// \deprecated
623 void test_deprecated_3(int a) __attribute__((availability(macosx,introduced=10.4)));
624 
625 /// Aaa
626 /// \deprecated
627 void test_deprecated_4(int a) __attribute__((unavailable));
628 
629 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
630 /// Aaa
631 /// \deprecated
632 void test_deprecated_5(int a);
633 
634 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+3 {{add a deprecation attribute to the declaration to silence this warning}}
635 /// Aaa
636 /// \deprecated
637 void test_deprecated_6(int a) {
638 }
639 
640 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
641 /// Aaa
642 /// \deprecated
643 template<typename T>
644 void test_deprecated_7(T aaa);
645 
646 
647 // rdar://12397511
648 // expected-note@+2 {{previous command '\headerfile' here}}
649 // expected-warning@+2 {{duplicated command '\headerfile'}}
650 /// \headerfile ""
651 /// \headerfile foo.h
652 int test__headerfile_1(int a);
653 
654 
655 /// \invariant aaa
656 void test_invariant_1(int a);
657 
658 // expected-warning@+1 {{empty paragraph passed to '\invariant' command}}
659 /// \invariant
660 void test_invariant_2(int a);
661 
662 
663 // no-warning
664 /// \returns Aaa
665 int test_returns_right_decl_1(int);
666 
667 class test_returns_right_decl_2 {
668   // no-warning
669   /// \returns Aaa
670   int test_returns_right_decl_3(int);
671 };
672 
673 // no-warning
674 /// \returns Aaa
675 template<typename T>
676 int test_returns_right_decl_4(T aaa);
677 
678 // no-warning
679 /// \returns Aaa
680 template<>
681 int test_returns_right_decl_4(int aaa);
682 
683 /// \returns Aaa
684 template<typename T>
685 T test_returns_right_decl_5(T aaa);
686 
687 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
688 /// \returns Aaa
689 int test_returns_wrong_decl_1_backslash;
690 
691 // rdar://13066276
692 // Check that the diagnostic uses the same command marker as the comment.
693 // expected-warning@+1 {{'@returns' command used in a comment that is not attached to a function or method declaration}}
694 /// @returns Aaa
695 int test_returns_wrong_decl_1_at;
696 
697 // expected-warning@+1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
698 /// \return Aaa
699 int test_returns_wrong_decl_2;
700 
701 // expected-warning@+1 {{'\result' command used in a comment that is not attached to a function or method declaration}}
702 /// \result Aaa
703 int test_returns_wrong_decl_3;
704 
705 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
706 /// \returns Aaa
707 void test_returns_wrong_decl_4(int);
708 
709 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
710 /// \returns Aaa
711 template<typename T>
712 void test_returns_wrong_decl_5(T aaa);
713 
714 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
715 /// \returns Aaa
716 template<>
717 void test_returns_wrong_decl_5(int aaa);
718 
719 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
720 /// \returns Aaa
721 struct test_returns_wrong_decl_6 { };
722 
723 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
724 /// \returns Aaa
725 class test_returns_wrong_decl_7 {
726   // expected-warning@+1 {{'\returns' command used in a comment that is attached to a constructor}}
727   /// \returns Aaa
728   test_returns_wrong_decl_7();
729 
730   // expected-warning@+1 {{'\returns' command used in a comment that is attached to a destructor}}
731   /// \returns Aaa
732   ~test_returns_wrong_decl_7();
733 };
734 
735 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
736 /// \returns Aaa
737 enum test_returns_wrong_decl_8 {
738   // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
739   /// \returns Aaa
740   test_returns_wrong_decl_9
741 };
742 
743 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
744 /// \returns Aaa
745 namespace test_returns_wrong_decl_10 { };
746 
747 // rdar://13094352
748 // expected-warning@+1 {{'@function' command should be used in a comment attached to a function declaration}}
749 /*!	@function test_function
750 */
751 typedef unsigned int Base64Flags;
752 unsigned test_function(Base64Flags inFlags);
753 
754 // expected-warning@+1 {{'@callback' command should be used in a comment attached to a pointer to function declaration}}
755 /*! @callback test_callback
756 */
757 typedef unsigned int BaseFlags;
758 unsigned (*test_callback)(BaseFlags inFlags);
759 
760 // expected-warning@+1 {{'\endverbatim' command does not terminate a verbatim text block}}
761 /// \endverbatim
762 int test_verbatim_1();
763 
764 // expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}}
765 /// \endcode
766 int test_verbatim_2();
767 
768 // FIXME: we give a bad diagnostic here because we throw away non-documentation
769 // comments early.
770 //
771 // expected-warning@+3 {{'\endcode' command does not terminate a verbatim text block}}
772 /// \code
773 //  foo
774 /// \endcode
775 int test_verbatim_3();
776 
777 
778 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
779 int test1; ///< \brief\author Aaa
780 
781 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
782 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
783 int test2, ///< \brief\author Aaa
784     test3; ///< \brief\author Aaa
785 
786 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
787 int test4; ///< \brief
788            ///< \author Aaa
789 
790 
791 class TestRelates {};
792 
793 /// \relates TestRelates
794 /// \brief Aaa
795 void test_relates_1();
796 
797 /// \related TestRelates
798 /// \brief Aaa
799 void test_relates_2();
800 
801 /// \relatesalso TestRelates
802 /// \brief Aaa
803 void test_relates_3();
804 
805 /// \relatedalso TestRelates
806 /// \brief Aaa
807 void test_relates_4();
808 
809 
810 // Check that we attach the comment to the declaration during parsing in the
811 // following cases.  The test is based on the fact that we don't parse
812 // documentation comments that are not attached to anything.
813 
814 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
815 /// \brief\author Aaa
816 int test_attach1;
817 
818 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
819 /// \brief\author Aaa
820 int test_attach2(int);
821 
822 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
823 /// \brief\author Aaa
824 struct test_attach3 {
825   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
826   /// \brief\author Aaa
827   int test_attach4;
828 
829   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
830   int test_attach5; ///< \brief\author Aaa
831 
832   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
833   /// \brief\author Aaa
834   int test_attach6(int);
835 };
836 
837 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
838 /// \brief\author Aaa
839 class test_attach7 {
840   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
841   /// \brief\author Aaa
842   int test_attach8;
843 
844   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
845   int test_attach9; ///< \brief\author Aaa
846 
847   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
848   /// \brief\author Aaa
849   int test_attach10(int);
850 };
851 
852 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
853 /// \brief\author Aaa
854 enum test_attach9 {
855   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
856   /// \brief\author Aaa
857   test_attach10,
858 
859   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
860   test_attach11 ///< \brief\author Aaa
861 };
862 
863 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
864 /// \brief\author Aaa
865 struct test_noattach12 *test_attach13;
866 
867 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
868 /// \brief\author Aaa
869 typedef struct test_noattach14 *test_attach15;
870 
871 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
872 /// \brief\author Aaa
873 typedef struct test_attach16 { int a; } test_attach17;
874 
875 struct S { int a; };
876 
877 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
878 /// \brief\author Aaa
879 struct S *test_attach18;
880 
881 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
882 /// \brief\author Aaa
883 typedef struct S *test_attach19;
884 
885 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
886 /// \brief\author Aaa
887 struct test_attach20;
888 
889 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
890 /// \brief\author Aaa
891 typedef struct test_attach21 {
892   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
893   /// \brief\author Aaa
894   int test_attach22;
895 } test_attach23;
896 
897 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
898 /// \brief\author Aaa
899 namespace test_attach24 {
900   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
901   /// \brief\author Aaa
902   namespace test_attach25 {
903   }
904 }
905 
906 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
907 /// \brief\author Aaa
908 /// \tparam T Aaa
909 template<typename T>
910 void test_attach26(T aaa);
911 
912 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
913 /// \brief\author Aaa
914 /// \tparam T Aaa
915 template<typename T, typename U>
916 void test_attach27(T aaa, U bbb);
917 
918 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
919 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
920 /// \brief\author Aaa
921 /// \tparam T Aaa
922 template<>
923 void test_attach27(int aaa, int bbb);
924 
925 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
926 /// \brief\author Aaa
927 /// \tparam T Aaa
928 template<typename T>
929 class test_attach28 {
930   T aaa;
931 };
932 
933 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
934 /// \brief\author Aaa
935 using test_attach29 = test_attach28<int>;
936 
937 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
938 /// \brief\author Aaa
939 /// \tparam T Aaa
940 template<typename T, typename U>
941 class test_attach30 { };
942 
943 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
944 /// \brief\author Aaa
945 /// \tparam T Aaa
946 template<typename T>
947 class test_attach30<T, int> { };
948 
949 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
950 /// \brief\author Aaa
951 template<>
952 class test_attach30<int, int> { };
953 
954 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
955 /// \brief\author Aaa
956 template<typename T>
957 using test_attach31 = test_attach30<T, int>;
958 
959 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
960 /// \brief\author Aaa
961 /// \tparam T Aaa
962 template<typename T, typename U, typename V>
963 class test_attach32 { };
964 
965 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
966 /// \brief\author Aaa
967 /// \tparam T Aaa
968 template<typename T, typename U>
969 class test_attach32<T, U, int> { };
970 
971 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
972 /// \brief\author Aaa
973 /// \tparam T Aaa
974 template<typename T>
975 class test_attach32<T, int, int> { };
976 
977 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
978 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
979 /// \brief\author Aaa
980 /// \tparam T Aaa
981 template<>
982 class test_attach32<int, int, int> { };
983 
984 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
985 /// \brief\author Aaa
986 class test_attach33 {
987   // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
988   /// \brief\author Aaa
989   /// \tparam T Aaa
990   template<typename T, typename U>
991   void test_attach34(T aaa, U bbb);
992 };
993 
994 template<typename T>
995 class test_attach35 {
996   // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
997   // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
998   /// \brief\author Aaa
999   /// \tparam T Aaa
1000   template<typename TT, typename UU>
1001   void test_attach36(TT aaa, UU bbb);
1002 };
1003 
1004 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
1005 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
1006 /// \brief\author Aaa
1007 /// \tparam T Aaa
1008 template<> template<>
1009 void test_attach35<int>::test_attach36(int aaa, int bbb) {}
1010 
1011 template<typename T>
1012 class test_attach37 {
1013   // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
1014   // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}}
1015   /// \brief\author Aaa
1016   /// \tparam T Aaa
1017   void test_attach38(int aaa, int bbb);
1018 
1019   void test_attach39(int aaa, int bbb);
1020 };
1021 
1022 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
1023 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
1024 /// \brief\author Aaa
1025 /// \tparam T Aaa
1026 template<>
1027 void test_attach37<int>::test_attach38(int aaa, int bbb) {}
1028 
1029 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
1030 /// \brief\author Aaa
1031 /// \tparam T Aaa
1032 template<typename T>
1033 void test_attach37<T>::test_attach39(int aaa, int bbb) {}
1034 
1035 // We used to emit warning that parameter 'a' is not found because we parsed
1036 // the comment in context of the redeclaration which does not have parameter
1037 // names.
1038 template <typename T>
1039 struct test_attach38 {
1040   /*!
1041     \param a  First param
1042     \param b  Second param
1043   */
1044   template <typename B>
1045   void test_attach39(T a, B b);
1046 };
1047 
1048 template <>
1049 template <typename B>
1050 void test_attach38<int>::test_attach39(int, B);
1051 
1052 // The inline comments expect a string after the command.
1053 // expected-warning@+1 {{'\a' command does not have an argument}}
1054 /// \a
1055 int test_inline_no_argument_a_bad(int);
1056 
1057 /// \a A
1058 int test_inline_no_argument_a_good(int);
1059 
1060 // expected-warning@+1 {{'@b' command does not have an argument}}
1061 /// @b
1062 int test_inline_no_argument_b_bad(int);
1063 
1064 /// @b A
1065 int test_inline_no_argument_b_good(int);
1066 
1067 // expected-warning@+1 {{'\c' command does not have an argument}}
1068 /// \c
1069 int test_inline_no_argument_c_bad(int);
1070 
1071 /// \c A
1072 int test_inline_no_argument_c_good(int);
1073 
1074 // expected-warning@+1 {{'\e' command does not have an argument}}
1075 /// \e
1076 int test_inline_no_argument_e_bad(int);
1077 
1078 /// \e A
1079 int test_inline_no_argument_e_good(int);
1080 
1081 // expected-warning@+1 {{'\em' command does not have an argument}}
1082 /// \em
1083 int test_inline_no_argument_em_bad(int);
1084 
1085 /// \em A
1086 int test_inline_no_argument_em_good(int);
1087 
1088 // expected-warning@+1 {{'\p' command does not have an argument}}
1089 /// \p
1090 int test_inline_no_argument_p_bad(int);
1091 
1092 /// \p A
1093 int test_inline_no_argument_p_good(int);
1094 
1095 // PR13411, reduced.  We used to crash on this.
1096 /**
1097  * @code Aaa.
1098  */
1099 void test_nocrash1(int);
1100 
1101 // We used to crash on this.
1102 // expected-warning@+2 {{empty paragraph passed to '\param' command}}
1103 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
1104 /// \param\brief
1105 void test_nocrash2(int);
1106 
1107 // PR13593, example 1 and 2
1108 
1109 /**
1110 * Bla.
1111 */
1112 template <typename>
1113 void test_nocrash3();
1114 
1115 /// Foo
1116 template <typename, typename>
1117 void test_nocrash4() { }
1118 
1119 template <typename>
1120 void test_nocrash3()
1121 {
1122 }
1123 
1124 // PR13593, example 3
1125 
1126 /**
1127  * aaa
1128  */
1129 template <typename T>
1130 inline T test_nocrash5(T a1)
1131 {
1132     return a1;
1133 }
1134 
1135 ///
1136 //,
1137 
1138 inline void test_nocrash6()
1139 {
1140     test_nocrash5(1);
1141 }
1142 
1143 // We used to crash on this.
1144 
1145 /*!
1146   Blah.
1147 */
1148 typedef const struct test_nocrash7 * test_nocrash8;
1149 
1150 // We used to crash on this.
1151 
1152 // expected-warning@+1 {{unknown command tag name}}
1153 /// aaa \unknown aaa \unknown aaa
1154 int test_nocrash9;
1155 
1156 // We used to crash on this.  PR15068
1157 
1158 // expected-warning@+2 {{empty paragraph passed to '@param' command}}
1159 // expected-warning@+2 {{empty paragraph passed to '@param' command}}
1160 ///@param x
1161 ///@param y
1162 int test_nocrash10(int x, int y);
1163 
1164 // expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'x' not found in the function declaration}}
1165 // expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'y' not found in the function declaration}}
1166 ///@param x
1167 ///@param y
1168 int test_nocrash11();
1169 
1170 // expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'x' not found in the function declaration}}
1171 // expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'y' not found in the function declaration}}
1172 /**
1173 @param x
1174 @param y
1175 **/
1176 int test_nocrash12();
1177 
1178 // expected-warning@+2 {{empty paragraph passed to '@param' command}}
1179 // expected-warning@+1 {{empty paragraph passed to '@param' command}}
1180 ///@param x@param y
1181 int test_nocrash13(int x, int y);
1182 
1183 /**
1184  * \verbatim
1185  * Aaa
1186  **/
1187 int test_nocrash14();
1188 
1189 // rdar://12379114
1190 // expected-warning@+2 {{'@union' command should not be used in a comment attached to a non-union declaration}}
1191 /*!
1192    @union U This is new
1193 */
1194 struct U { int iS; };
1195 
1196 /*!
1197   @union U1
1198 */
1199 union U1 {int i; };
1200 
1201 // expected-warning@+2 {{'@struct' command should not be used in a comment attached to a non-struct declaration}}
1202 /*!
1203  @struct S2
1204 */
1205 union S2 {};
1206 
1207 /*!
1208   @class C1
1209 */
1210 class C1;
1211 
1212 /*!
1213   @struct S3;
1214 */
1215 class S3;
1216 
1217 // rdar://14124702
1218 //----------------------------------------------------------------------
1219 /// @class Predicate Predicate.h "lldb/Host/Predicate.h"
1220 /// @brief A C++ wrapper class for providing threaded access to a value
1221 /// of type T.
1222 ///
1223 /// A templatized class.
1224 /// specified values.
1225 //----------------------------------------------------------------------
1226 template <class T, class T1>
1227 class Predicate
1228 {
1229 };
1230 
1231 //----------------------------------------------------------------------
1232 /// @class Predicate<int, char> Predicate.h "lldb/Host/Predicate.h"
1233 /// @brief A C++ wrapper class for providing threaded access to a value
1234 /// of type T.
1235 ///
1236 /// A template specialization class.
1237 //----------------------------------------------------------------------
1238 template<> class Predicate<int, char>
1239 {
1240 };
1241 
1242 //----------------------------------------------------------------------
1243 /// @class Predicate<T, int> Predicate.h "lldb/Host/Predicate.h"
1244 /// @brief A C++ wrapper class for providing threaded access to a value
1245 /// of type T.
1246 ///
1247 /// A partial specialization template class.
1248 //----------------------------------------------------------------------
1249 template<class T> class Predicate<T, int>
1250 {
1251 };
1252 
1253 /*!     @function test_function
1254 */
1255 template <class T> T test_function (T arg);
1256 
1257 /*!     @function test_function<int>
1258 */
1259 template <> int test_function<int> (int arg);
1260 
1261 namespace AllowParamAndReturnsOnFunctionPointerVars {
1262 
1263 /**
1264  * functionPointerVariable
1265  *
1266  * @param i is integer.
1267  * @returns integer.
1268  */
1269 int (*functionPointerVariable)(int i);
1270 
1271 struct HasFields {
1272   /**
1273    * functionPointerField
1274    *
1275    * @param i is integer.
1276    * @returns integer.
1277    */
1278   int (*functionPointerField)(int i);
1279 };
1280 
1281 // expected-warning@+5 {{'\returns' command used in a comment that is attached to a function returning void}}
1282 /**
1283  * functionPointerVariable
1284  *
1285  * \param p not here.
1286  * \returns integer.
1287  */
1288 void (*functionPointerVariableThatLeadsNowhere)();
1289 
1290 // Still warn about param/returns commands for variables that don't specify
1291 // the type directly:
1292 
1293 /**
1294  * FunctionPointerTypedef
1295  *
1296  * \param i is integer.
1297  * \returns integer.
1298  */
1299 typedef int (*FunctionPointerTypedef)(int i);
1300 
1301 /**
1302  * FunctionPointerTypealias
1303  *
1304  * \param i is integer.
1305  * \returns integer.
1306  */
1307 using FunctionPointerTypealias = int (*)(int i);
1308 
1309 // expected-warning@+5 {{'@param' command used in a comment that is not attached to a function declaration}}
1310 // expected-warning@+5 {{'@returns' command used in a comment that is not attached to a function or method declaration}}
1311 /**
1312  * functionPointerVariable
1313  *
1314  * @param i is integer.
1315  * @returns integer.
1316  */
1317 FunctionPointerTypedef functionPointerTypedefVariable;
1318 
1319 struct HasMoreFields {
1320   // expected-warning@+5 {{'\param' command used in a comment that is not attached to a function declaration}}
1321   // expected-warning@+5 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
1322   /**
1323    * functionPointerTypealiasField
1324    *
1325    * \param i is integer.
1326    * \returns integer.
1327    */
1328   FunctionPointerTypealias functionPointerTypealiasField;
1329 };
1330 
1331 }
1332 
1333 /*!
1334  * Function pointer typedef with variadic params.
1335  *
1336  * @param a
1337  * works
1338  *
1339  * @param ...
1340  * now should work too.
1341  */
1342 typedef void (*VariadicFnType)(int a, ...);
1343 
1344 /*!
1345  * Function pointer type alias with variadic params.
1346  *
1347  * @param a
1348  * works
1349  *
1350  * @param ...
1351  * now should work too.
1352  */
1353 using VariadicFnType2 = void (*)(int a, ...);
1354 
1355 // expected-warning@+2 {{empty paragraph passed to '@note' command}}
1356 /**
1357 @note
1358 \f$\texttt{mu}_{00}=\texttt{m}_{00}\f$, \f$\texttt{nu}_{00}=1\f$
1359 \f$\texttt{nu}_{10}=\texttt{mu}_{10}=\texttt{mu}_{01}=\texttt{mu}_{10}=0\f$
1360  */
1361 class EmptyNoteNoCrash {
1362 };
1363