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