blob: c6ba0151b917a19ad1ad7a3ba969f8d4d3b43fe6 [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
3// expected-warning@+1 {{expected quoted string after equals sign}}
4/// <a href=>
5int test_html1(int);
6
7// expected-warning@+1 {{expected quoted string after equals sign}}
8/// <a href==>
9int test_html2(int);
10
11// expected-warning@+2 {{expected quoted string after equals sign}}
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000012// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000013/// <a href= blah
14int test_html3(int);
15
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 =>
18int test_html4(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 "aaa">
22int test_html5(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 a="b" =>
26int test_html6(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" "aaa">
30int test_html7(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" =
34int test_html8(int);
35
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000036// expected-warning@+2 {{HTML start tag prematurely ended, expected attribute name or '>'}} expected-note@+1 {{HTML tag started here}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000037/** Aaa bbb<ccc ddd eee
38 * fff ggg.
39 */
40int test_html9(int);
41
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000042// expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000043/** Aaa bbb<ccc ddd eee 42%
44 * fff ggg.
45 */
46int test_html10(int);
47
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000048// expected-warning@+1 {{HTML end tag 'br' is forbidden}}
Dmitri Gribenko3d986982012-07-12 23:37:09 +000049/// <br></br>
50int test_html11(int);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000051
52/// <blockquote>Meow</blockquote>
53int test_html_nesting1(int);
54
55/// <b><i>Meow</i></b>
56int test_html_nesting2(int);
57
58/// <p>Aaa<br>
59/// Bbb</p>
60int test_html_nesting3(int);
61
62/// <p>Aaa<br />
63/// Bbb</p>
64int test_html_nesting4(int);
65
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000066// expected-warning@+1 {{HTML end tag does not match any start tag}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000067/// <b><i>Meow</a>
68int test_html_nesting5(int);
69
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000070// expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
71// expected-warning@+1 {{HTML end tag does not match any start tag}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000072/// <b><i>Meow</b></b>
73int test_html_nesting6(int);
74
Dmitri Gribenko3f38bf22012-07-13 00:44:24 +000075// expected-warning@+2 {{HTML start tag 'i' closed by 'b'}}
76// expected-warning@+1 {{HTML end tag does not match any start tag}}
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000077/// <b><i>Meow</b></i>
78int test_html_nesting7(int);
79
80
81// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +000082/// \brief\returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000083int test_block_command1(int);
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_command2(int);
88
89// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
90/// \brief
Dmitri Gribenko9443c572012-08-06 17:08:27 +000091/// \returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000092int test_block_command3(int);
93
94// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
95/// \brief
96///
Dmitri Gribenko9443c572012-08-06 17:08:27 +000097/// \returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +000098int test_block_command4(int);
99
100// There is trailing whitespace on one of the following lines, don't remove it!
101// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
102/// \brief
103///
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000104/// \returns Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000105int test_block_command5(int);
106
Dmitri Gribenko858e69f2012-07-19 00:01:56 +0000107/// \brief \c Aaa
108int test_block_command6(int);
109
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000110// expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\brief' here}}
111/// \brief Aaa
112///
113/// Bbb
114///
115/// \brief Ccc
116int test_duplicate_brief1(int);
117
118// expected-warning@+5 {{duplicated command '\short'}} expected-note@+1 {{previous command '\short' here}}
119/// \short Aaa
120///
121/// Bbb
122///
123/// \short Ccc
124int test_duplicate_brief2(int);
125
126// expected-warning@+5 {{duplicated command '\brief'}} expected-note@+1 {{previous command '\short' (an alias of '\brief') here}}
127/// \short Aaa
128///
129/// Bbb
130///
131/// \brief Ccc
132int test_duplicate_brief3(int);
133
134
135// expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\return' here}}
136/// \return Aaa
137///
138/// Bbb
139///
140/// \return Ccc
141int test_duplicate_returns1(int);
142
143// expected-warning@+5 {{duplicated command '\returns'}} expected-note@+1 {{previous command '\returns' here}}
144/// \returns Aaa
145///
146/// Bbb
147///
148/// \returns Ccc
149int test_duplicate_returns2(int);
150
151// expected-warning@+5 {{duplicated command '\result'}} expected-note@+1 {{previous command '\result' here}}
152/// \result Aaa
153///
154/// Bbb
155///
156/// \result Ccc
157int test_duplicate_returns3(int);
158
159// expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\returns' (an alias of '\return') here}}
160/// \returns Aaa
161///
162/// Bbb
163///
164/// \return Ccc
165int test_duplicate_returns4(int);
166
167
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000168// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
169/// \param a Blah blah.
170int test_param1;
171
172// expected-warning@+1 {{empty paragraph passed to '\param' command}}
173/// \param
174/// \param a Blah blah.
175int test_param2(int a);
176
177// expected-warning@+1 {{empty paragraph passed to '\param' command}}
178/// \param a
179int test_param3(int a);
180
181/// \param a Blah blah.
182int test_param4(int a);
183
184/// \param [in] a Blah blah.
185int test_param5(int a);
186
187/// \param [out] a Blah blah.
188int test_param6(int a);
189
190/// \param [in,out] a Blah blah.
191int test_param7(int a);
192
193// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
194/// \param [ in ] a Blah blah.
195int test_param8(int a);
196
197// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
198/// \param [in, out] a Blah blah.
199int test_param9(int a);
200
201// expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}}
202/// \param [ junk] a Blah blah.
203int test_param10(int a);
204
Dmitri Gribenko2e721042012-07-24 21:56:59 +0000205// expected-warning@+1 {{parameter 'a' not found in the function declaration}}
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000206/// \param a Blah blah.
207int test_param11();
208
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000209// expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
210/// \param A Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000211int test_param12(int a);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000212
213// expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
214/// \param aab Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000215int test_param13(int aaa, int bbb);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000216
217// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
218/// \param aab Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000219int test_param14(int bbb, int ccc);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000220
221class C {
222 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
223 /// \param aaa Blah blah.
224 C(int bbb, int ccc);
225
226 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
227 /// \param aaa Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000228 int test_param15(int bbb, int ccc);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000229};
230
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000231// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
232/// \param aab Blah blah.
233template<typename T>
234void test_param16(int bbb, int ccc);
235
Dmitri Gribenko65822772012-07-24 21:44:16 +0000236// expected-warning@+3 {{parameter 'a' is already documented}}
237// expected-note@+1 {{previous documentation}}
238/// \param a Aaa.
239/// \param a Aaa.
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000240int test_param17(int a);
Dmitri Gribenko65822772012-07-24 21:44:16 +0000241
242// expected-warning@+4 {{parameter 'x2' is already documented}}
243// expected-note@+2 {{previous documentation}}
244/// \param x1 Aaa.
245/// \param x2 Bbb.
246/// \param x2 Ccc.
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000247int test_param18(int x1, int x2, int x3);
248
249
250// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
251/// \tparam T Aaa
252int test_tparam1;
253
254// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
255/// \tparam T Aaa
256void test_tparam2(int aaa);
257
258// expected-warning@+1 {{empty paragraph passed to '\tparam' command}}
259/// \tparam
260/// \param aaa Blah blah
261template<typename T>
262void test_tparam3(T aaa);
263
264// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
265/// \tparam T Aaa
266template<typename TT>
267void test_tparam4(TT aaa);
268
269// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
270/// \tparam T Aaa
271template<typename TT>
272class test_tparam5 {
273 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}}
274 /// \tparam T Aaa
275 template<typename TTT>
276 void test_tparam6(TTT aaa);
277};
278
279/// \tparam T1 Aaa
280/// \tparam T2 Bbb
281template<typename T1, typename T2>
282void test_tparam7(T1 aaa, T2 bbb);
283
284// expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}
285/// \tparam SomTy Aaa
286/// \tparam OtherTy Bbb
287template<typename SomeTy, typename OtherTy>
288void test_tparam8(SomeTy aaa, OtherTy bbb);
289
290// expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}}
291/// \tparam T1 Aaa
292/// \tparam T1 Bbb
293template<typename T1, typename T2>
294void test_tparam9(T1 aaa, T2 bbb);
295
296/// \tparam T Aaa
297/// \tparam TT Bbb
298template<template<typename T> class TT>
299void test_tparam10(TT<int> aaa);
300
301/// \tparam T Aaa
302/// \tparam TT Bbb
303/// \tparam TTT Ccc
304template<template<template<typename T> class TT, class C> class TTT>
305void test_tparam11();
306
307/// \tparam I Aaa
308template<int I>
309void test_tparam12();
310
Dmitri Gribenko967e5d72012-08-02 21:36:57 +0000311template<typename T, typename U>
312class test_tparam13 { };
313
314/// \tparam T Aaa
315template<typename T>
316using test_tparam14 = test_tparam13<T, int>;
317
318// expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
319/// \tparam U Aaa
320template<typename T>
321using test_tparam15 = test_tparam13<T, int>;
322
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000323// no-warning
324/// \returns Aaa
325int test_returns_right_decl_1(int);
326
327class test_returns_right_decl_2 {
328 // no-warning
329 /// \returns Aaa
330 int test_returns_right_decl_3(int);
331};
332
333// no-warning
334/// \returns Aaa
335template<typename T>
336int test_returns_right_decl_4(T aaa);
337
338// no-warning
339/// \returns Aaa
340template<>
341int test_returns_right_decl_4(int aaa);
342
343/// \returns Aaa
344template<typename T>
345T test_returns_right_decl_5(T aaa);
346
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000347// 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 +0000348/// \returns Aaa
349int test_returns_wrong_decl_1;
350
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000351// 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 +0000352/// \return Aaa
353int test_returns_wrong_decl_2;
354
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000355// 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 +0000356/// \result Aaa
357int test_returns_wrong_decl_3;
358
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000359// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000360/// \returns Aaa
361void test_returns_wrong_decl_4(int);
362
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000363// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000364/// \returns Aaa
365template<typename T>
366void test_returns_wrong_decl_5(T aaa);
367
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000368// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000369/// \returns Aaa
370template<>
371void test_returns_wrong_decl_5(int aaa);
372
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000373// 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 +0000374/// \returns Aaa
375struct test_returns_wrong_decl_6 { };
376
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000377// 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 +0000378/// \returns Aaa
379class test_returns_wrong_decl_7 {
380 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a constructor}}
381 /// \returns Aaa
382 test_returns_wrong_decl_7();
383
384 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a destructor}}
385 /// \returns Aaa
386 ~test_returns_wrong_decl_7();
387};
388
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000389// 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 +0000390/// \returns Aaa
391enum test_returns_wrong_decl_8 {
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000392 // 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 +0000393 /// \returns Aaa
394 test_returns_wrong_decl_9
395};
396
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000397// 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 +0000398/// \returns Aaa
399namespace test_returns_wrong_decl_10 { };
400
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000401
402// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000403int test1; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000404
405// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
406// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000407int test2, ///< \brief\author Aaa
408 test3; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000409
410// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
411int test4; ///< \brief
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000412 ///< \author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000413
414
415// Check that we attach the comment to the declaration during parsing in the
416// following cases. The test is based on the fact that we don't parse
417// documentation comments that are not attached to anything.
418
419// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000420/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000421int test_attach1;
422
423// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000424/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000425int test_attach2(int);
426
427// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000428/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000429struct test_attach3 {
430 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000431 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000432 int test_attach4;
433
434 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000435 int test_attach5; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000436
437 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000438 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000439 int test_attach6(int);
440};
441
442// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000443/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000444class test_attach7 {
445 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000446 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000447 int test_attach8;
448
449 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000450 int test_attach9; ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000451
452 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000453 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000454 int test_attach10(int);
455};
456
457// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000458/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000459enum test_attach9 {
460 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000461 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000462 test_attach10,
463
464 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000465 test_attach11 ///< \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000466};
467
468// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000469/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000470struct test_noattach12 *test_attach13;
471
472// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000473/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000474typedef struct test_noattach14 *test_attach15;
475
476// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000477/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000478typedef struct test_attach16 { int a; } test_attach17;
479
480struct S { int a; };
481
482// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000483/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000484struct S *test_attach18;
485
486// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000487/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000488typedef struct S *test_attach19;
489
490// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000491/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000492struct test_attach20;
493
494// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000495/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000496typedef struct test_attach21 {
497 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000498 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000499 int test_attach22;
500} test_attach23;
501
502// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000503/// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000504namespace test_attach24 {
505 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000506 /// \brief\author Aaa
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000507 namespace test_attach25 {
508 }
509}
510
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000511// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000512/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000513/// \tparam T Aaa
514template<typename T>
515void test_attach26(T aaa);
516
517// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000518/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000519/// \tparam T Aaa
520template<typename T, typename U>
521void test_attach27(T aaa, U bbb);
522
523// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
524// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000525/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000526/// \tparam T Aaa
527template<>
528void test_attach27(int aaa, int bbb);
529
530// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000531/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000532/// \tparam T Aaa
533template<typename T>
534class test_attach28 {
535 T aaa;
536};
537
538// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000539/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000540using test_attach29 = test_attach28<int>;
541
542// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000543/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000544/// \tparam T Aaa
545template<typename T, typename U>
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000546class test_attach30 { };
547
548// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000549/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000550/// \tparam T Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000551template<typename T>
552class test_attach30<T, int> { };
553
554// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000555/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000556template<>
557class test_attach30<int, int> { };
558
559// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000560/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000561template<typename T>
562using test_attach31 = test_attach30<T, int>;
563
564// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000565/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000566/// \tparam T Aaa
567template<typename T, typename U, typename V>
568class test_attach32 { };
569
570// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000571/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000572/// \tparam T Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000573template<typename T, typename U>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000574class test_attach32<T, U, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000575
576// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000577/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000578/// \tparam T Aaa
579template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000580class test_attach32<T, int, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000581
582// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
583// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000584/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000585/// \tparam T Aaa
586template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000587class test_attach32<int, int, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000588
589// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000590/// \brief\author Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000591class test_attach33 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000592 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000593 /// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000594 /// \tparam T Aaa
595 template<typename T, typename U>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000596 void test_attach34(T aaa, U bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000597};
598
599template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000600class test_attach35 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000601 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
602 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000603 /// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000604 /// \tparam T Aaa
605 template<typename TT, typename UU>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000606 void test_attach36(TT aaa, UU bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000607};
608
609// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
610// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000611/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000612/// \tparam T Aaa
613template<> template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000614void test_attach35<int>::test_attach36(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000615
616template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000617class test_attach37 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000618 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
619 // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000620 /// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000621 /// \tparam T Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000622 void test_attach38(int aaa, int bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000623};
624
625// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000626/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000627/// \tparam T Aaa
628template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000629void test_attach37<T>::test_attach38(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000630
631// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
632// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
Dmitri Gribenko9443c572012-08-06 17:08:27 +0000633/// \brief\author Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000634/// \tparam T Aaa
635template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000636void test_attach37<int>::test_attach38(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000637
638
Dmitri Gribenko9f08f492012-07-20 20:18:53 +0000639// PR13411, reduced. We used to crash on this.
640/**
641 * @code Aaa.
642 */
643void test_nocrash1(int);
644
Dmitri Gribenkoe5deb792012-07-30 18:05:28 +0000645// We used to crash on this.
646// expected-warning@+2 {{empty paragraph passed to '\param' command}}
647// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
648/// \param\brief
649void test_nocrash2(int);
650