blob: d054fac99073b38b2b6c23032e29b856e3d475e9 [file] [log] [blame]
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +00001// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +00002
Dmitri Gribenkof303d4c2012-08-07 17:54:38 +00003// 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
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +00007// expected-warning@+1 {{expected quoted string after equals sign}}
8/// <a href=>
9int test_html1(int);
10
11// expected-warning@+1 {{expected quoted string after equals sign}}
12/// <a href==>
13int test_html2(int);
14
15// expected-warning@+2 {{expected quoted string after equals sign}}
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000016// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000017/// <a href= blah
18int test_html3(int);
19
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000020// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000021/// <a =>
22int test_html4(int);
23
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000024// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000025/// <a "aaa">
26int test_html5(int);
27
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000028// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000029/// <a a="b" =>
30int test_html6(int);
31
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000032// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000033/// <a a="b" "aaa">
34int test_html7(int);
35
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000036// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000037/// <a a="b" =
38int test_html8(int);
39
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000040// expected-warning@+2 {{HTML start tag prematurely ended, expected attribute name or '>'}} expected-note@+1 {{HTML tag started here}}
Dmitri Gribenko834a5bd2012-08-22 22:56:08 +000041/** Aaa bbb<img ddd eee
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000042 * fff ggg.
43 */
44int test_html9(int);
45
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000046// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenko834a5bd2012-08-22 22:56:08 +000047/** Aaa bbb<img ddd eee 42%
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000048 * fff ggg.
49 */
50int test_html10(int);
51
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000052// expected-warning@+1 {{HTML end tag 'br' is forbidden}}
Dmitri Gribenko3d986982012-07-12 23:37:09 +000053/// <br></br>
54int test_html11(int);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000055
56/// <blockquote>Meow</blockquote>
57int test_html_nesting1(int);
58
59/// <b><i>Meow</i></b>
60int test_html_nesting2(int);
61
62/// <p>Aaa<br>
63/// Bbb</p>
64int test_html_nesting3(int);
65
66/// <p>Aaa<br />
67/// Bbb</p>
68int test_html_nesting4(int);
69
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000070// expected-warning@+1 {{HTML end tag does not match any start tag}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000071/// <b><i>Meow</a>
72int test_html_nesting5(int);
73
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000074// expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
75// expected-warning@+1 {{HTML end tag does not match any start tag}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000076/// <b><i>Meow</b></b>
77int test_html_nesting6(int);
78
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000079// expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
80// expected-warning@+1 {{HTML end tag does not match any start tag}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000081/// <b><i>Meow</b></i>
82int test_html_nesting7(int);
83
84
85// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +000086/// \brief\returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000087int test_block_command1(int);
88
89// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +000090/// \brief \returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000091int test_block_command2(int);
92
93// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
94/// \brief
Dmitri Gribenko9443c572012-08-06 17:08:27 +000095/// \returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000096int test_block_command3(int);
97
98// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
99/// \brief
100///
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000101/// \returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000102int test_block_command4(int);
103
104// There is trailing whitespace on one of the following lines, don't remove it!
105// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
106/// \brief
107///
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000108/// \returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000109int test_block_command5(int);
110
Dmitri Gribenko858e69f2012-07-19 00:01:56 +0000111/// \brief \c Aaa
112int test_block_command6(int);
113
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000114// expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\brief' here}}
115/// \brief Aaa
116///
117/// Bbb
118///
119/// \brief Ccc
120int test_duplicate_brief1(int);
121
122// expected-warning@+5 {{duplicated command '\short'}} expected-note@+1 {{previous command '\short' here}}
123/// \short Aaa
124///
125/// Bbb
126///
127/// \short Ccc
128int test_duplicate_brief2(int);
129
130// expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\short' (an alias of '\brief') here}}
131/// \short Aaa
132///
133/// Bbb
134///
135/// \brief Ccc
136int test_duplicate_brief3(int);
137
138
139// expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\return' here}}
140/// \return Aaa
141///
142/// Bbb
143///
144/// \return Ccc
145int test_duplicate_returns1(int);
146
147// expected-warning@+5 {{duplicated command '\returns'}} expected-note@+1 {{previous command '\returns' here}}
148/// \returns Aaa
149///
150/// Bbb
151///
152/// \returns Ccc
153int test_duplicate_returns2(int);
154
155// expected-warning@+5 {{duplicated command '\result'}} expected-note@+1 {{previous command '\result' here}}
156/// \result Aaa
157///
158/// Bbb
159///
160/// \result Ccc
161int test_duplicate_returns3(int);
162
163// expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\returns' (an alias of '\return') here}}
164/// \returns Aaa
165///
166/// Bbb
167///
168/// \return Ccc
169int test_duplicate_returns4(int);
170
171
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000172// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
173/// \param a Blah blah.
174int test_param1;
175
176// expected-warning@+1 {{empty paragraph passed to '\param' command}}
177/// \param
178/// \param a Blah blah.
179int test_param2(int a);
180
181// expected-warning@+1 {{empty paragraph passed to '\param' command}}
182/// \param a
183int test_param3(int a);
184
185/// \param a Blah blah.
186int test_param4(int a);
187
188/// \param [in] a Blah blah.
189int test_param5(int a);
190
191/// \param [out] a Blah blah.
192int test_param6(int a);
193
194/// \param [in,out] a Blah blah.
195int test_param7(int a);
196
197// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
198/// \param [ in ] a Blah blah.
199int test_param8(int a);
200
201// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
202/// \param [in, out] a Blah blah.
203int test_param9(int a);
204
205// expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}}
206/// \param [ junk] a Blah blah.
207int test_param10(int a);
208
Dmitri Gribenko2e721042012-07-24 21:56:59 +0000209// expected-warning@+1 {{parameter 'a' not found in the function declaration}}
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000210/// \param a Blah blah.
211int test_param11();
212
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000213// expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
214/// \param A Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000215int test_param12(int a);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000216
217// expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
218/// \param aab Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000219int test_param13(int aaa, int bbb);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000220
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000221// expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'bbb'?}}
222/// \param aaa Blah blah.
223/// \param aab Blah blah.
224int test_param14(int aaa, int bbb);
225
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000226// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
227/// \param aab Blah blah.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000228int test_param15(int bbb, int ccc);
229
230// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
231/// \param aab Ccc.
232/// \param aaa Aaa.
233/// \param bbb Bbb.
234int test_param16(int aaa, int bbb);
235
236// expected-warning@+2 {{parameter 'aab' not found in the function declaration}}
237/// \param aaa Aaa.
238/// \param aab Ccc.
239/// \param bbb Bbb.
240int test_param17(int aaa, int bbb);
241
242// expected-warning@+3 {{parameter 'aab' not found in the function declaration}}
243/// \param aaa Aaa.
244/// \param bbb Bbb.
245/// \param aab Ccc.
246int test_param18(int aaa, int bbb);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000247
248class C {
249 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
250 /// \param aaa Blah blah.
251 C(int bbb, int ccc);
252
253 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
254 /// \param aaa Blah blah.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000255 int test_param19(int bbb, int ccc);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000256};
257
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000258// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
259/// \param aab Blah blah.
260template<typename T>
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000261void test_param20(int bbb, int ccc);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000262
Dmitri Gribenko65822772012-07-24 21:44:16 +0000263// expected-warning@+3 {{parameter 'a' is already documented}}
264// expected-note@+1 {{previous documentation}}
265/// \param a Aaa.
266/// \param a Aaa.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000267int test_param21(int a);
Dmitri Gribenko65822772012-07-24 21:44:16 +0000268
269// expected-warning@+4 {{parameter 'x2' is already documented}}
270// expected-note@+2 {{previous documentation}}
271/// \param x1 Aaa.
272/// \param x2 Bbb.
273/// \param x2 Ccc.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000274int test_param22(int x1, int x2, int x3);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000275
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000276// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
Dmitri Gribenko70ff1092012-08-24 00:05:30 +0000277/// \param aaa Meow.
278/// \param bbb Bbb.
279/// \returns aaa.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000280typedef int test_param23(int aaa, int ccc);
Dmitri Gribenko70ff1092012-08-24 00:05:30 +0000281
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000282// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
Dmitri Gribenko70ff1092012-08-24 00:05:30 +0000283/// \param aaa Meow.
284/// \param bbb Bbb.
285/// \returns aaa.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000286typedef int (*test_param24)(int aaa, int ccc);
Dmitri Gribenko70ff1092012-08-24 00:05:30 +0000287
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000288// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
Dmitri Gribenko70ff1092012-08-24 00:05:30 +0000289/// \param aaa Meow.
290/// \param bbb Bbb.
291/// \returns aaa.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000292typedef int (* const test_param25)(int aaa, int ccc);
Dmitri Gribenko70ff1092012-08-24 00:05:30 +0000293
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000294// expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}}
Dmitri Gribenko70ff1092012-08-24 00:05:30 +0000295/// \param aaa Meow.
296/// \param bbb Bbb.
297/// \returns aaa.
Dmitri Gribenko9edd2c82012-08-24 17:45:39 +0000298typedef int (C::*test_param26)(int aaa, int ccc);
299
Dmitri Gribenkoec504e02012-09-15 21:13:36 +0000300typedef int (*test_param27)(int aaa);
301
302// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
303/// \param aaa Meow.
304typedef test_param27 test_param28;
305
Dmitri Gribenko151b2ac2013-03-04 19:39:33 +0000306// rdar://13066276
307// expected-warning@+1 {{'@param' command used in a comment that is not attached to a function declaration}}
308/// @param aaa Meow.
309typedef unsigned int test_param29;
310
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000311
312// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
313/// \tparam T Aaa
314int test_tparam1;
315
316// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
317/// \tparam T Aaa
318void test_tparam2(int aaa);
319
320// expected-warning@+1 {{empty paragraph passed to '\tparam' command}}
321/// \tparam
322/// \param aaa Blah blah
323template<typename T>
324void test_tparam3(T aaa);
325
326// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
327/// \tparam T Aaa
328template<typename TT>
329void test_tparam4(TT aaa);
330
331// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
332/// \tparam T Aaa
333template<typename TT>
334class test_tparam5 {
335 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}}
336 /// \tparam T Aaa
337 template<typename TTT>
338 void test_tparam6(TTT aaa);
339};
340
341/// \tparam T1 Aaa
342/// \tparam T2 Bbb
343template<typename T1, typename T2>
344void test_tparam7(T1 aaa, T2 bbb);
345
346// expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}
347/// \tparam SomTy Aaa
348/// \tparam OtherTy Bbb
349template<typename SomeTy, typename OtherTy>
350void test_tparam8(SomeTy aaa, OtherTy bbb);
351
352// expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}}
353/// \tparam T1 Aaa
354/// \tparam T1 Bbb
355template<typename T1, typename T2>
356void test_tparam9(T1 aaa, T2 bbb);
357
358/// \tparam T Aaa
359/// \tparam TT Bbb
360template<template<typename T> class TT>
361void test_tparam10(TT<int> aaa);
362
363/// \tparam T Aaa
364/// \tparam TT Bbb
365/// \tparam TTT Ccc
366template<template<template<typename T> class TT, class C> class TTT>
367void test_tparam11();
368
369/// \tparam I Aaa
370template<int I>
371void test_tparam12();
372
Dmitri Gribenko967e5d72012-08-02 21:36:57 +0000373template<typename T, typename U>
374class test_tparam13 { };
375
376/// \tparam T Aaa
377template<typename T>
378using test_tparam14 = test_tparam13<T, int>;
379
380// expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
381/// \tparam U Aaa
382template<typename T>
383using test_tparam15 = test_tparam13<T, int>;
384
Dmitri Gribenkod1e5c0d2013-01-27 21:18:39 +0000385// ----
386
387/// \tparam T Aaa
388template<typename T>
389class test_tparam16 { };
390
391typedef test_tparam16<int> test_tparam17;
392typedef test_tparam16<double> test_tparam18;
393
394// ----
395
396template<typename T>
397class test_tparam19;
398
399typedef test_tparam19<int> test_tparam20;
400typedef test_tparam19<double> test_tparam21;
401
402/// \tparam T Aaa
403template<typename T>
404class test_tparam19 { };
405
406// ----
407
Dmitri Gribenkoabcf0dc2012-09-13 20:36:01 +0000408
409/// Aaa
410/// \deprecated Bbb
Dmitri Gribenko0bd98382012-09-22 21:47:50 +0000411void test_deprecated_1(int a) __attribute__((deprecated));
Dmitri Gribenkoabcf0dc2012-09-13 20:36:01 +0000412
413// We don't want \deprecated to warn about empty paragraph. It is fine to use
414// \deprecated by itself without explanations.
415
416/// Aaa
417/// \deprecated
Dmitri Gribenko0bd98382012-09-22 21:47:50 +0000418void test_deprecated_2(int a) __attribute__((deprecated));
419
420/// Aaa
421/// \deprecated
422void test_deprecated_3(int a) __attribute__((availability(macosx,introduced=10.4)));
423
424/// Aaa
425/// \deprecated
426void test_deprecated_4(int a) __attribute__((unavailable));
427
428// 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}}
429/// Aaa
430/// \deprecated
431void test_deprecated_5(int a);
432
433// 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}}
434/// Aaa
435/// \deprecated
436void test_deprecated_6(int a) {
437}
438
439// expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
440/// Aaa
441/// \deprecated
442template<typename T>
443void test_deprecated_7(T aaa);
Dmitri Gribenkoabcf0dc2012-09-13 20:36:01 +0000444
445
Dmitri Gribenko151b2ac2013-03-04 19:39:33 +0000446// rdar://12397511
447// expected-note@+2 {{previous command '\headerfile' here}}
448// expected-warning@+2 {{duplicated command '\headerfile'}}
449/// \headerfile ""
450/// \headerfile foo.h
451int test__headerfile_1(int a);
452
453
Dmitri Gribenko388a5942012-09-14 15:37:29 +0000454/// \invariant aaa
455void test_invariant_1(int a);
456
457// expected-warning@+1 {{empty paragraph passed to '\invariant' command}}
458/// \invariant
459void test_invariant_2(int a);
460
461
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000462// no-warning
463/// \returns Aaa
464int test_returns_right_decl_1(int);
465
466class test_returns_right_decl_2 {
467 // no-warning
468 /// \returns Aaa
469 int test_returns_right_decl_3(int);
470};
471
472// no-warning
473/// \returns Aaa
474template<typename T>
475int test_returns_right_decl_4(T aaa);
476
477// no-warning
478/// \returns Aaa
479template<>
480int test_returns_right_decl_4(int aaa);
481
482/// \returns Aaa
483template<typename T>
484T test_returns_right_decl_5(T aaa);
485
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000486// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000487/// \returns Aaa
488int test_returns_wrong_decl_1;
489
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000490// expected-warning@+1 {{'\return' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000491/// \return Aaa
492int test_returns_wrong_decl_2;
493
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000494// expected-warning@+1 {{'\result' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000495/// \result Aaa
496int test_returns_wrong_decl_3;
497
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000498// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000499/// \returns Aaa
500void test_returns_wrong_decl_4(int);
501
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000502// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000503/// \returns Aaa
504template<typename T>
505void test_returns_wrong_decl_5(T aaa);
506
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000507// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000508/// \returns Aaa
509template<>
510void test_returns_wrong_decl_5(int aaa);
511
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000512// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000513/// \returns Aaa
514struct test_returns_wrong_decl_6 { };
515
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000516// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000517/// \returns Aaa
518class test_returns_wrong_decl_7 {
519 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a constructor}}
520 /// \returns Aaa
521 test_returns_wrong_decl_7();
522
523 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a destructor}}
524 /// \returns Aaa
525 ~test_returns_wrong_decl_7();
526};
527
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000528// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000529/// \returns Aaa
530enum test_returns_wrong_decl_8 {
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000531 // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000532 /// \returns Aaa
533 test_returns_wrong_decl_9
534};
535
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000536// expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000537/// \returns Aaa
538namespace test_returns_wrong_decl_10 { };
539
Dmitri Gribenko151b2ac2013-03-04 19:39:33 +0000540// rdar://13066276
541// expected-warning@+1 {{'@returns' command used in a comment that is not attached to a function or method declaration}}
542/// @returns Aaa
543typedef unsigned int test_returns_wrong_decl_11;
544
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000545
Dmitri Gribenko36cbbe92012-11-18 00:30:31 +0000546// expected-warning@+1 {{'\endverbatim' command does not terminate a verbatim text block}}
547/// \endverbatim
548int test_verbatim_1();
549
550// expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}}
551/// \endcode
552int test_verbatim_2();
553
554// FIXME: we give a bad diagnostic here because we throw away non-documentation
555// comments early.
556//
NAKAMURA Takumibf823c02012-11-18 02:34:33 +0000557// expected-warning@+3 {{'\endcode' command does not terminate a verbatim text block}}
Dmitri Gribenko36cbbe92012-11-18 00:30:31 +0000558/// \code
559// foo
560/// \endcode
561int test_verbatim_3();
562
563
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000564// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000565int test1; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000566
567// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
568// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000569int test2, ///< \brief\author Aaa
570 test3; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000571
572// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
573int test4; ///< \brief
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000574 ///< \author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000575
576
577// Check that we attach the comment to the declaration during parsing in the
578// following cases. The test is based on the fact that we don't parse
579// documentation comments that are not attached to anything.
580
581// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000582/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000583int test_attach1;
584
585// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000586/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000587int test_attach2(int);
588
589// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000590/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000591struct test_attach3 {
592 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000593 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000594 int test_attach4;
595
596 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000597 int test_attach5; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000598
599 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000600 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000601 int test_attach6(int);
602};
603
604// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000605/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000606class test_attach7 {
607 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000608 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000609 int test_attach8;
610
611 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000612 int test_attach9; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000613
614 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000615 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000616 int test_attach10(int);
617};
618
619// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000620/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000621enum test_attach9 {
622 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000623 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000624 test_attach10,
625
626 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000627 test_attach11 ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000628};
629
630// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000631/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000632struct test_noattach12 *test_attach13;
633
634// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000635/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000636typedef struct test_noattach14 *test_attach15;
637
638// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000639/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000640typedef struct test_attach16 { int a; } test_attach17;
641
642struct S { int a; };
643
644// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000645/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000646struct S *test_attach18;
647
648// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000649/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000650typedef struct S *test_attach19;
651
652// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000653/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000654struct test_attach20;
655
656// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000657/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000658typedef struct test_attach21 {
659 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000660 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000661 int test_attach22;
662} test_attach23;
663
664// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000665/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000666namespace test_attach24 {
667 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000668 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000669 namespace test_attach25 {
670 }
671}
672
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000673// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000674/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000675/// \tparam T Aaa
676template<typename T>
677void test_attach26(T aaa);
678
679// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000680/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000681/// \tparam T Aaa
682template<typename T, typename U>
683void test_attach27(T aaa, U bbb);
684
685// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
686// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000687/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000688/// \tparam T Aaa
689template<>
690void test_attach27(int aaa, int bbb);
691
692// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000693/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000694/// \tparam T Aaa
695template<typename T>
696class test_attach28 {
697 T aaa;
698};
699
700// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000701/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000702using test_attach29 = test_attach28<int>;
703
704// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000705/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000706/// \tparam T Aaa
707template<typename T, typename U>
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000708class test_attach30 { };
709
710// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000711/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000712/// \tparam T Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000713template<typename T>
714class test_attach30<T, int> { };
715
716// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000717/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000718template<>
719class test_attach30<int, int> { };
720
721// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000722/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000723template<typename T>
724using test_attach31 = test_attach30<T, int>;
725
726// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000727/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000728/// \tparam T Aaa
729template<typename T, typename U, typename V>
730class test_attach32 { };
731
732// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000733/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000734/// \tparam T Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000735template<typename T, typename U>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000736class test_attach32<T, U, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000737
738// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000739/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000740/// \tparam T Aaa
741template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000742class test_attach32<T, int, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000743
744// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
745// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000746/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000747/// \tparam T Aaa
748template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000749class test_attach32<int, int, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000750
751// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000752/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000753class test_attach33 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000754 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000755 /// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000756 /// \tparam T Aaa
757 template<typename T, typename U>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000758 void test_attach34(T aaa, U bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000759};
760
761template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000762class test_attach35 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000763 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
764 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000765 /// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000766 /// \tparam T Aaa
767 template<typename TT, typename UU>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000768 void test_attach36(TT aaa, UU bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000769};
770
771// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
772// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000773/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000774/// \tparam T Aaa
775template<> template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000776void test_attach35<int>::test_attach36(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000777
778template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000779class test_attach37 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000780 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
781 // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000782 /// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000783 /// \tparam T Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000784 void test_attach38(int aaa, int bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000785
Dmitri Gribenkoc41ace92012-08-14 17:17:18 +0000786 void test_attach39(int aaa, int bbb);
787};
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000788
789// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
790// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000791/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000792/// \tparam T Aaa
793template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000794void test_attach37<int>::test_attach38(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000795
Dmitri Gribenkoc41ace92012-08-14 17:17:18 +0000796// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
797/// \brief\author Aaa
798/// \tparam T Aaa
799template<typename T>
800void test_attach37<T>::test_attach39(int aaa, int bbb) {}
801
Fariborz Jahanianc9320092013-03-04 20:08:47 +0000802// expected-warning@+1 {{'@tparam' command used in a comment that is not attached to a template declaration}}
803/// @tparam T Aaa
804int test_tparam22;
805
Dmitri Gribenko1599eac2012-08-16 18:19:43 +0000806// We used to emit warning that parameter 'a' is not found because we parsed
807// the comment in context of the redeclaration which does not have parameter
808// names.
809template <typename T>
810struct test_attach38 {
811 /*!
812 \param a First param
813 \param b Second param
814 */
815 template <typename B>
816 void test_attach39(T a, B b);
817};
818
819template <>
820template <typename B>
821void test_attach38<int>::test_attach39(int, B);
Dmitri Gribenkoc41ace92012-08-14 17:17:18 +0000822
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000823
Dmitri Gribenko9f08f492012-07-20 20:18:53 +0000824// PR13411, reduced. We used to crash on this.
825/**
826 * @code Aaa.
827 */
828void test_nocrash1(int);
829
Dmitri Gribenkoe5deb792012-07-30 18:05:28 +0000830// We used to crash on this.
831// expected-warning@+2 {{empty paragraph passed to '\param' command}}
832// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
833/// \param\brief
834void test_nocrash2(int);
835
Dmitri Gribenkoc41ace92012-08-14 17:17:18 +0000836// PR13593, example 1 and 2
Douglas Gregorcd81df22012-08-13 16:37:30 +0000837
838/**
839* Bla.
840*/
841template <typename>
842void test_nocrash3();
843
844/// Foo
845template <typename, typename>
846void test_nocrash4() { }
847
848template <typename>
849void test_nocrash3()
850{
851}
Dmitri Gribenkoc41ace92012-08-14 17:17:18 +0000852
853// PR13593, example 3
854
855/**
856 * aaa
857 */
858template <typename T>
859inline T test_nocrash5(T a1)
860{
861 return a1;
862}
863
864///
865//,
866
867inline void test_nocrash6()
868{
869 test_nocrash5(1);
870}
871
872// We used to crash on this.
873
874/*!
875 Blah.
876*/
877typedef const struct test_nocrash7 * test_nocrash8;
878
Dmitri Gribenkob0b8a962012-09-11 19:22:03 +0000879// We used to crash on this.
880
881/// aaa \unknown aaa \unknown aaa
882int test_nocrash9;
883
Dmitri Gribenko10442562013-01-26 00:36:14 +0000884
885// We used to crash on this. PR15068
886
Fariborz Jahanianc98e9132013-03-01 22:51:30 +0000887// expected-warning@+2 {{empty paragraph passed to '@param' command}}
888// expected-warning@+2 {{empty paragraph passed to '@param' command}}
Dmitri Gribenko10442562013-01-26 00:36:14 +0000889///@param x
890///@param y
891int test_nocrash10(int x, int y);
892
Fariborz Jahanianc98e9132013-03-01 22:51:30 +0000893// expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'x' not found in the function declaration}}
894// expected-warning@+2 {{empty paragraph passed to '@param' command}} expected-warning@+2 {{parameter 'y' not found in the function declaration}}
Dmitri Gribenko10442562013-01-26 00:36:14 +0000895///@param x
896///@param y
897int test_nocrash11();
898
Fariborz Jahanianc98e9132013-03-01 22:51:30 +0000899// expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'x' not found in the function declaration}}
900// expected-warning@+3 {{empty paragraph passed to '@param' command}} expected-warning@+3 {{parameter 'y' not found in the function declaration}}
Dmitri Gribenko10442562013-01-26 00:36:14 +0000901/**
902@param x
903@param y
904**/
905int test_nocrash12();
906
Fariborz Jahanianc98e9132013-03-01 22:51:30 +0000907// expected-warning@+2 {{empty paragraph passed to '@param' command}}
908// expected-warning@+1 {{empty paragraph passed to '@param' command}}
Dmitri Gribenko10442562013-01-26 00:36:14 +0000909///@param x@param y
910int test_nocrash13(int x, int y);
911