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