blob: 19d43ab488fe27668a07ab408492b203bd2606f8 [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}}
82/// \brief\brief Aaa
83int test_block_command1(int);
84
85// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
86/// \brief \brief Aaa
87int test_block_command2(int);
88
89// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
90/// \brief
91/// \brief Aaa
92int test_block_command3(int);
93
94// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
95/// \brief
96///
97/// \brief Aaa
98int 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///
104/// \brief Aaa
105int test_block_command5(int);
106
Dmitri Gribenko858e69f2012-07-19 00:01:56 +0000107/// \brief \c Aaa
108int test_block_command6(int);
109
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000110// expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}}
111/// \param a Blah blah.
112int test_param1;
113
114// expected-warning@+1 {{empty paragraph passed to '\param' command}}
115/// \param
116/// \param a Blah blah.
117int test_param2(int a);
118
119// expected-warning@+1 {{empty paragraph passed to '\param' command}}
120/// \param a
121int test_param3(int a);
122
123/// \param a Blah blah.
124int test_param4(int a);
125
126/// \param [in] a Blah blah.
127int test_param5(int a);
128
129/// \param [out] a Blah blah.
130int test_param6(int a);
131
132/// \param [in,out] a Blah blah.
133int test_param7(int a);
134
135// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
136/// \param [ in ] a Blah blah.
137int test_param8(int a);
138
139// expected-warning@+1 {{whitespace is not allowed in parameter passing direction}}
140/// \param [in, out] a Blah blah.
141int test_param9(int a);
142
143// expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}}
144/// \param [ junk] a Blah blah.
145int test_param10(int a);
146
Dmitri Gribenko2e721042012-07-24 21:56:59 +0000147// expected-warning@+1 {{parameter 'a' not found in the function declaration}}
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000148/// \param a Blah blah.
149int test_param11();
150
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000151// expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
152/// \param A Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000153int test_param12(int a);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000154
155// expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
156/// \param aab Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000157int test_param13(int aaa, int bbb);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000158
159// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
160/// \param aab Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000161int test_param14(int bbb, int ccc);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000162
163class C {
164 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
165 /// \param aaa Blah blah.
166 C(int bbb, int ccc);
167
168 // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}}
169 /// \param aaa Blah blah.
Dmitri Gribenko56bf6fd2012-07-24 21:46:24 +0000170 int test_param15(int bbb, int ccc);
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000171};
172
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000173// expected-warning@+1 {{parameter 'aab' not found in the function declaration}}
174/// \param aab Blah blah.
175template<typename T>
176void test_param16(int bbb, int ccc);
177
Dmitri Gribenko65822772012-07-24 21:44:16 +0000178// expected-warning@+3 {{parameter 'a' is already documented}}
179// expected-note@+1 {{previous documentation}}
180/// \param a Aaa.
181/// \param a Aaa.
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000182int test_param17(int a);
Dmitri Gribenko65822772012-07-24 21:44:16 +0000183
184// expected-warning@+4 {{parameter 'x2' is already documented}}
185// expected-note@+2 {{previous documentation}}
186/// \param x1 Aaa.
187/// \param x2 Bbb.
188/// \param x2 Ccc.
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000189int test_param18(int x1, int x2, int x3);
190
191
192// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
193/// \tparam T Aaa
194int test_tparam1;
195
196// expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}}
197/// \tparam T Aaa
198void test_tparam2(int aaa);
199
200// expected-warning@+1 {{empty paragraph passed to '\tparam' command}}
201/// \tparam
202/// \param aaa Blah blah
203template<typename T>
204void test_tparam3(T aaa);
205
206// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
207/// \tparam T Aaa
208template<typename TT>
209void test_tparam4(TT aaa);
210
211// expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}}
212/// \tparam T Aaa
213template<typename TT>
214class test_tparam5 {
215 // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}}
216 /// \tparam T Aaa
217 template<typename TTT>
218 void test_tparam6(TTT aaa);
219};
220
221/// \tparam T1 Aaa
222/// \tparam T2 Bbb
223template<typename T1, typename T2>
224void test_tparam7(T1 aaa, T2 bbb);
225
226// expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}
227/// \tparam SomTy Aaa
228/// \tparam OtherTy Bbb
229template<typename SomeTy, typename OtherTy>
230void test_tparam8(SomeTy aaa, OtherTy bbb);
231
232// expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}}
233/// \tparam T1 Aaa
234/// \tparam T1 Bbb
235template<typename T1, typename T2>
236void test_tparam9(T1 aaa, T2 bbb);
237
238/// \tparam T Aaa
239/// \tparam TT Bbb
240template<template<typename T> class TT>
241void test_tparam10(TT<int> aaa);
242
243/// \tparam T Aaa
244/// \tparam TT Bbb
245/// \tparam TTT Ccc
246template<template<template<typename T> class TT, class C> class TTT>
247void test_tparam11();
248
249/// \tparam I Aaa
250template<int I>
251void test_tparam12();
252
Dmitri Gribenko967e5d72012-08-02 21:36:57 +0000253template<typename T, typename U>
254class test_tparam13 { };
255
256/// \tparam T Aaa
257template<typename T>
258using test_tparam14 = test_tparam13<T, int>;
259
260// expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
261/// \tparam U Aaa
262template<typename T>
263using test_tparam15 = test_tparam13<T, int>;
264
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000265// no-warning
266/// \returns Aaa
267int test_returns_right_decl_1(int);
268
269class test_returns_right_decl_2 {
270 // no-warning
271 /// \returns Aaa
272 int test_returns_right_decl_3(int);
273};
274
275// no-warning
276/// \returns Aaa
277template<typename T>
278int test_returns_right_decl_4(T aaa);
279
280// no-warning
281/// \returns Aaa
282template<>
283int test_returns_right_decl_4(int aaa);
284
285/// \returns Aaa
286template<typename T>
287T test_returns_right_decl_5(T aaa);
288
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000289// 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 +0000290/// \returns Aaa
291int test_returns_wrong_decl_1;
292
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000293// 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 +0000294/// \return Aaa
295int test_returns_wrong_decl_2;
296
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000297// 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 +0000298/// \result Aaa
299int test_returns_wrong_decl_3;
300
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000301// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000302/// \returns Aaa
303void test_returns_wrong_decl_4(int);
304
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000305// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000306/// \returns Aaa
307template<typename T>
308void test_returns_wrong_decl_5(T aaa);
309
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000310// expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}}
Dmitri Gribenko89ab7d02012-08-03 21:15:32 +0000311/// \returns Aaa
312template<>
313void test_returns_wrong_decl_5(int aaa);
314
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000315// 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 +0000316/// \returns Aaa
317struct test_returns_wrong_decl_6 { };
318
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000319// 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 +0000320/// \returns Aaa
321class test_returns_wrong_decl_7 {
322 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a constructor}}
323 /// \returns Aaa
324 test_returns_wrong_decl_7();
325
326 // expected-warning@+1 {{'\returns' command used in a comment that is attached to a destructor}}
327 /// \returns Aaa
328 ~test_returns_wrong_decl_7();
329};
330
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000331// 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 +0000332/// \returns Aaa
333enum test_returns_wrong_decl_8 {
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000334 // 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 +0000335 /// \returns Aaa
336 test_returns_wrong_decl_9
337};
338
Dmitri Gribenko88815f32012-08-06 16:29:26 +0000339// 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 +0000340/// \returns Aaa
341namespace test_returns_wrong_decl_10 { };
342
Dmitri Gribenkoa5ef44f2012-07-11 21:38:39 +0000343
344// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
345int test1; ///< \brief\brief Aaa
346
347// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
348// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
349int test2, ///< \brief\brief Aaa
350 test3; ///< \brief\brief Aaa
351
352// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
353int test4; ///< \brief
354 ///< \brief Aaa
355
356
357// Check that we attach the comment to the declaration during parsing in the
358// following cases. The test is based on the fact that we don't parse
359// documentation comments that are not attached to anything.
360
361// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
362/// \brief\brief Aaa
363int test_attach1;
364
365// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
366/// \brief\brief Aaa
367int test_attach2(int);
368
369// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
370/// \brief\brief Aaa
371struct test_attach3 {
372 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
373 /// \brief\brief Aaa
374 int test_attach4;
375
376 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
377 int test_attach5; ///< \brief\brief Aaa
378
379 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
380 /// \brief\brief Aaa
381 int test_attach6(int);
382};
383
384// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
385/// \brief\brief Aaa
386class test_attach7 {
387 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
388 /// \brief\brief Aaa
389 int test_attach8;
390
391 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
392 int test_attach9; ///< \brief\brief Aaa
393
394 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
395 /// \brief\brief Aaa
396 int test_attach10(int);
397};
398
399// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
400/// \brief\brief Aaa
401enum test_attach9 {
402 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
403 /// \brief\brief Aaa
404 test_attach10,
405
406 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
407 test_attach11 ///< \brief\brief Aaa
408};
409
410// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
411/// \brief\brief Aaa
412struct test_noattach12 *test_attach13;
413
414// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
415/// \brief\brief Aaa
416typedef struct test_noattach14 *test_attach15;
417
418// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
419/// \brief\brief Aaa
420typedef struct test_attach16 { int a; } test_attach17;
421
422struct S { int a; };
423
424// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
425/// \brief\brief Aaa
426struct S *test_attach18;
427
428// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
429/// \brief\brief Aaa
430typedef struct S *test_attach19;
431
432// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
433/// \brief\brief Aaa
434struct test_attach20;
435
436// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
437/// \brief\brief Aaa
438typedef struct test_attach21 {
439 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
440 /// \brief\brief Aaa
441 int test_attach22;
442} test_attach23;
443
444// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
445/// \brief\brief Aaa
446namespace test_attach24 {
447 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
448 /// \brief\brief Aaa
449 namespace test_attach25 {
450 }
451}
452
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000453// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
454/// \brief\brief Aaa
455/// \tparam T Aaa
456template<typename T>
457void test_attach26(T aaa);
458
459// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
460/// \brief\brief Aaa
461/// \tparam T Aaa
462template<typename T, typename U>
463void test_attach27(T aaa, U bbb);
464
465// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
466// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
467/// \brief\brief Aaa
468/// \tparam T Aaa
469template<>
470void test_attach27(int aaa, int bbb);
471
472// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
473/// \brief\brief Aaa
474/// \tparam T Aaa
475template<typename T>
476class test_attach28 {
477 T aaa;
478};
479
480// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
481/// \brief\brief Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000482using test_attach29 = test_attach28<int>;
483
484// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
485/// \brief\brief Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000486/// \tparam T Aaa
487template<typename T, typename U>
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000488class test_attach30 { };
489
490// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
491/// \brief\brief Aaa
492/// \tparam T Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000493template<typename T>
494class test_attach30<T, int> { };
495
496// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
497/// \brief\brief Aaa
498template<>
499class test_attach30<int, int> { };
500
501// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
502/// \brief\brief Aaa
503template<typename T>
504using test_attach31 = test_attach30<T, int>;
505
506// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
507/// \brief\brief Aaa
508/// \tparam T Aaa
509template<typename T, typename U, typename V>
510class test_attach32 { };
511
512// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
513/// \brief\brief Aaa
514/// \tparam T Aaa
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000515template<typename T, typename U>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000516class test_attach32<T, U, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000517
518// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
519/// \brief\brief Aaa
520/// \tparam T Aaa
521template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000522class test_attach32<T, int, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000523
524// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
525// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
526/// \brief\brief Aaa
527/// \tparam T Aaa
528template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000529class test_attach32<int, int, int> { };
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000530
531// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
532/// \brief\brief Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000533class test_attach33 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000534 // expected-warning@+1 {{empty paragraph passed to '\brief' command}}
535 /// \brief\brief Aaa
536 /// \tparam T Aaa
537 template<typename T, typename U>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000538 void test_attach34(T aaa, U bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000539};
540
541template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000542class test_attach35 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000543 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
544 // expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
545 /// \brief\brief Aaa
546 /// \tparam T Aaa
547 template<typename TT, typename UU>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000548 void test_attach36(TT aaa, UU bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000549};
550
551// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
552// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
553/// \brief\brief Aaa
554/// \tparam T Aaa
555template<> template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000556void test_attach35<int>::test_attach36(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000557
558template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000559class test_attach37 {
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000560 // expected-warning@+2 {{empty paragraph passed to '\brief' command}}
561 // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}}
562 /// \brief\brief Aaa
563 /// \tparam T Aaa
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000564 void test_attach38(int aaa, int bbb);
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000565};
566
567// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
568/// \brief\brief Aaa
569/// \tparam T Aaa
570template<typename T>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000571void test_attach37<T>::test_attach38(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000572
573// expected-warning@+2 {{empty paragraph passed to '\brief' command}}
574// expected-warning@+2 {{template parameter 'T' not found in the template declaration}}
575/// \brief\brief Aaa
576/// \tparam T Aaa
577template<>
Dmitri Gribenkoc27bc802012-08-02 20:49:51 +0000578void test_attach37<int>::test_attach38(int aaa, int bbb) {}
Dmitri Gribenko96b09862012-07-31 22:37:06 +0000579
580
Dmitri Gribenko9f08f492012-07-20 20:18:53 +0000581// PR13411, reduced. We used to crash on this.
582/**
583 * @code Aaa.
584 */
585void test_nocrash1(int);
586
Dmitri Gribenkoe5deb792012-07-30 18:05:28 +0000587// We used to crash on this.
588// expected-warning@+2 {{empty paragraph passed to '\param' command}}
589// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
590/// \param\brief
591void test_nocrash2(int);
592