Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -verify %s |
| 2 | |
| 3 | // expected-warning@+1 {{expected quoted string after equals sign}} |
| 4 | /// <a href=> |
| 5 | int test_html1(int); |
| 6 | |
| 7 | // expected-warning@+1 {{expected quoted string after equals sign}} |
| 8 | /// <a href==> |
| 9 | int test_html2(int); |
| 10 | |
| 11 | // expected-warning@+2 {{expected quoted string after equals sign}} |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 12 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 13 | /// <a href= blah |
| 14 | int test_html3(int); |
| 15 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 16 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 17 | /// <a => |
| 18 | int test_html4(int); |
| 19 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 20 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 21 | /// <a "aaa"> |
| 22 | int test_html5(int); |
| 23 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 24 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 25 | /// <a a="b" => |
| 26 | int test_html6(int); |
| 27 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 28 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 29 | /// <a a="b" "aaa"> |
| 30 | int test_html7(int); |
| 31 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 32 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 33 | /// <a a="b" = |
| 34 | int test_html8(int); |
| 35 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 36 | // expected-warning@+2 {{HTML start tag prematurely ended, expected attribute name or '>'}} expected-note@+1 {{HTML tag started here}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 37 | /** Aaa bbb<ccc ddd eee |
| 38 | * fff ggg. |
| 39 | */ |
| 40 | int test_html9(int); |
| 41 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 42 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 43 | /** Aaa bbb<ccc ddd eee 42% |
| 44 | * fff ggg. |
| 45 | */ |
| 46 | int test_html10(int); |
| 47 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 48 | // expected-warning@+1 {{HTML end tag 'br' is forbidden}} |
Dmitri Gribenko | 3d98698 | 2012-07-12 23:37:09 +0000 | [diff] [blame] | 49 | /// <br></br> |
| 50 | int test_html11(int); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 51 | |
| 52 | /// <blockquote>Meow</blockquote> |
| 53 | int test_html_nesting1(int); |
| 54 | |
| 55 | /// <b><i>Meow</i></b> |
| 56 | int test_html_nesting2(int); |
| 57 | |
| 58 | /// <p>Aaa<br> |
| 59 | /// Bbb</p> |
| 60 | int test_html_nesting3(int); |
| 61 | |
| 62 | /// <p>Aaa<br /> |
| 63 | /// Bbb</p> |
| 64 | int test_html_nesting4(int); |
| 65 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 66 | // expected-warning@+1 {{HTML end tag does not match any start tag}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 67 | /// <b><i>Meow</a> |
| 68 | int test_html_nesting5(int); |
| 69 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 70 | // expected-warning@+2 {{HTML start tag 'i' closed by 'b'}} |
| 71 | // expected-warning@+1 {{HTML end tag does not match any start tag}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 72 | /// <b><i>Meow</b></b> |
| 73 | int test_html_nesting6(int); |
| 74 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 75 | // expected-warning@+2 {{HTML start tag 'i' closed by 'b'}} |
| 76 | // expected-warning@+1 {{HTML end tag does not match any start tag}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 77 | /// <b><i>Meow</b></i> |
| 78 | int test_html_nesting7(int); |
| 79 | |
| 80 | |
| 81 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 82 | /// \brief\brief Aaa |
| 83 | int test_block_command1(int); |
| 84 | |
| 85 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 86 | /// \brief \brief Aaa |
| 87 | int test_block_command2(int); |
| 88 | |
| 89 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 90 | /// \brief |
| 91 | /// \brief Aaa |
| 92 | int test_block_command3(int); |
| 93 | |
| 94 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 95 | /// \brief |
| 96 | /// |
| 97 | /// \brief Aaa |
| 98 | int test_block_command4(int); |
| 99 | |
| 100 | // There is trailing whitespace on one of the following lines, don't remove it! |
| 101 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 102 | /// \brief |
| 103 | /// |
| 104 | /// \brief Aaa |
| 105 | int test_block_command5(int); |
| 106 | |
Dmitri Gribenko | 858e69f | 2012-07-19 00:01:56 +0000 | [diff] [blame] | 107 | /// \brief \c Aaa |
| 108 | int test_block_command6(int); |
| 109 | |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 110 | // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}} |
| 111 | /// \param a Blah blah. |
| 112 | int test_param1; |
| 113 | |
| 114 | // expected-warning@+1 {{empty paragraph passed to '\param' command}} |
| 115 | /// \param |
| 116 | /// \param a Blah blah. |
| 117 | int test_param2(int a); |
| 118 | |
| 119 | // expected-warning@+1 {{empty paragraph passed to '\param' command}} |
| 120 | /// \param a |
| 121 | int test_param3(int a); |
| 122 | |
| 123 | /// \param a Blah blah. |
| 124 | int test_param4(int a); |
| 125 | |
| 126 | /// \param [in] a Blah blah. |
| 127 | int test_param5(int a); |
| 128 | |
| 129 | /// \param [out] a Blah blah. |
| 130 | int test_param6(int a); |
| 131 | |
| 132 | /// \param [in,out] a Blah blah. |
| 133 | int test_param7(int a); |
| 134 | |
| 135 | // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}} |
| 136 | /// \param [ in ] a Blah blah. |
| 137 | int test_param8(int a); |
| 138 | |
| 139 | // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}} |
| 140 | /// \param [in, out] a Blah blah. |
| 141 | int test_param9(int a); |
| 142 | |
| 143 | // expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}} |
| 144 | /// \param [ junk] a Blah blah. |
| 145 | int test_param10(int a); |
| 146 | |
Dmitri Gribenko | 2e72104 | 2012-07-24 21:56:59 +0000 | [diff] [blame] | 147 | // expected-warning@+1 {{parameter 'a' not found in the function declaration}} |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 148 | /// \param a Blah blah. |
| 149 | int test_param11(); |
| 150 | |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 151 | // expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}} |
| 152 | /// \param A Blah blah. |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 153 | int test_param12(int a); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 154 | |
| 155 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}} |
| 156 | /// \param aab Blah blah. |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 157 | int test_param13(int aaa, int bbb); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 158 | |
| 159 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} |
| 160 | /// \param aab Blah blah. |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 161 | int test_param14(int bbb, int ccc); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 162 | |
| 163 | class C { |
| 164 | // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}} |
| 165 | /// \param aaa Blah blah. |
| 166 | C(int bbb, int ccc); |
| 167 | |
| 168 | // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}} |
| 169 | /// \param aaa Blah blah. |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 170 | int test_param15(int bbb, int ccc); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 171 | }; |
| 172 | |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame^] | 173 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} |
| 174 | /// \param aab Blah blah. |
| 175 | template<typename T> |
| 176 | void test_param16(int bbb, int ccc); |
| 177 | |
Dmitri Gribenko | 6582277 | 2012-07-24 21:44:16 +0000 | [diff] [blame] | 178 | // expected-warning@+3 {{parameter 'a' is already documented}} |
| 179 | // expected-note@+1 {{previous documentation}} |
| 180 | /// \param a Aaa. |
| 181 | /// \param a Aaa. |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame^] | 182 | int test_param17(int a); |
Dmitri Gribenko | 6582277 | 2012-07-24 21:44:16 +0000 | [diff] [blame] | 183 | |
| 184 | // expected-warning@+4 {{parameter 'x2' is already documented}} |
| 185 | // expected-note@+2 {{previous documentation}} |
| 186 | /// \param x1 Aaa. |
| 187 | /// \param x2 Bbb. |
| 188 | /// \param x2 Ccc. |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame^] | 189 | int test_param18(int x1, int x2, int x3); |
| 190 | |
| 191 | |
| 192 | // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}} |
| 193 | /// \tparam T Aaa |
| 194 | int test_tparam1; |
| 195 | |
| 196 | // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}} |
| 197 | /// \tparam T Aaa |
| 198 | void test_tparam2(int aaa); |
| 199 | |
| 200 | // expected-warning@+1 {{empty paragraph passed to '\tparam' command}} |
| 201 | /// \tparam |
| 202 | /// \param aaa Blah blah |
| 203 | template<typename T> |
| 204 | void test_tparam3(T aaa); |
| 205 | |
| 206 | // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}} |
| 207 | /// \tparam T Aaa |
| 208 | template<typename TT> |
| 209 | void test_tparam4(TT aaa); |
| 210 | |
| 211 | // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}} |
| 212 | /// \tparam T Aaa |
| 213 | template<typename TT> |
| 214 | class test_tparam5 { |
| 215 | // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}} |
| 216 | /// \tparam T Aaa |
| 217 | template<typename TTT> |
| 218 | void test_tparam6(TTT aaa); |
| 219 | }; |
| 220 | |
| 221 | /// \tparam T1 Aaa |
| 222 | /// \tparam T2 Bbb |
| 223 | template<typename T1, typename T2> |
| 224 | void test_tparam7(T1 aaa, T2 bbb); |
| 225 | |
| 226 | // expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}} |
| 227 | /// \tparam SomTy Aaa |
| 228 | /// \tparam OtherTy Bbb |
| 229 | template<typename SomeTy, typename OtherTy> |
| 230 | void test_tparam8(SomeTy aaa, OtherTy bbb); |
| 231 | |
| 232 | // expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}} |
| 233 | /// \tparam T1 Aaa |
| 234 | /// \tparam T1 Bbb |
| 235 | template<typename T1, typename T2> |
| 236 | void test_tparam9(T1 aaa, T2 bbb); |
| 237 | |
| 238 | /// \tparam T Aaa |
| 239 | /// \tparam TT Bbb |
| 240 | template<template<typename T> class TT> |
| 241 | void test_tparam10(TT<int> aaa); |
| 242 | |
| 243 | /// \tparam T Aaa |
| 244 | /// \tparam TT Bbb |
| 245 | /// \tparam TTT Ccc |
| 246 | template<template<template<typename T> class TT, class C> class TTT> |
| 247 | void test_tparam11(); |
| 248 | |
| 249 | /// \tparam I Aaa |
| 250 | template<int I> |
| 251 | void test_tparam12(); |
| 252 | |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 253 | |
| 254 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 255 | int test1; ///< \brief\brief Aaa |
| 256 | |
| 257 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 258 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 259 | int test2, ///< \brief\brief Aaa |
| 260 | test3; ///< \brief\brief Aaa |
| 261 | |
| 262 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 263 | int test4; ///< \brief |
| 264 | ///< \brief Aaa |
| 265 | |
| 266 | |
| 267 | // Check that we attach the comment to the declaration during parsing in the |
| 268 | // following cases. The test is based on the fact that we don't parse |
| 269 | // documentation comments that are not attached to anything. |
| 270 | |
| 271 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 272 | /// \brief\brief Aaa |
| 273 | int test_attach1; |
| 274 | |
| 275 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 276 | /// \brief\brief Aaa |
| 277 | int test_attach2(int); |
| 278 | |
| 279 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 280 | /// \brief\brief Aaa |
| 281 | struct test_attach3 { |
| 282 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 283 | /// \brief\brief Aaa |
| 284 | int test_attach4; |
| 285 | |
| 286 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 287 | int test_attach5; ///< \brief\brief Aaa |
| 288 | |
| 289 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 290 | /// \brief\brief Aaa |
| 291 | int test_attach6(int); |
| 292 | }; |
| 293 | |
| 294 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 295 | /// \brief\brief Aaa |
| 296 | class test_attach7 { |
| 297 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 298 | /// \brief\brief Aaa |
| 299 | int test_attach8; |
| 300 | |
| 301 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 302 | int test_attach9; ///< \brief\brief Aaa |
| 303 | |
| 304 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 305 | /// \brief\brief Aaa |
| 306 | int test_attach10(int); |
| 307 | }; |
| 308 | |
| 309 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 310 | /// \brief\brief Aaa |
| 311 | enum test_attach9 { |
| 312 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 313 | /// \brief\brief Aaa |
| 314 | test_attach10, |
| 315 | |
| 316 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 317 | test_attach11 ///< \brief\brief Aaa |
| 318 | }; |
| 319 | |
| 320 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 321 | /// \brief\brief Aaa |
| 322 | struct test_noattach12 *test_attach13; |
| 323 | |
| 324 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 325 | /// \brief\brief Aaa |
| 326 | typedef struct test_noattach14 *test_attach15; |
| 327 | |
| 328 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 329 | /// \brief\brief Aaa |
| 330 | typedef struct test_attach16 { int a; } test_attach17; |
| 331 | |
| 332 | struct S { int a; }; |
| 333 | |
| 334 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 335 | /// \brief\brief Aaa |
| 336 | struct S *test_attach18; |
| 337 | |
| 338 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 339 | /// \brief\brief Aaa |
| 340 | typedef struct S *test_attach19; |
| 341 | |
| 342 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 343 | /// \brief\brief Aaa |
| 344 | struct test_attach20; |
| 345 | |
| 346 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 347 | /// \brief\brief Aaa |
| 348 | typedef struct test_attach21 { |
| 349 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 350 | /// \brief\brief Aaa |
| 351 | int test_attach22; |
| 352 | } test_attach23; |
| 353 | |
| 354 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 355 | /// \brief\brief Aaa |
| 356 | namespace test_attach24 { |
| 357 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 358 | /// \brief\brief Aaa |
| 359 | namespace test_attach25 { |
| 360 | } |
| 361 | } |
| 362 | |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame^] | 363 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 364 | /// \brief\brief Aaa |
| 365 | /// \tparam T Aaa |
| 366 | template<typename T> |
| 367 | void test_attach26(T aaa); |
| 368 | |
| 369 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 370 | /// \brief\brief Aaa |
| 371 | /// \tparam T Aaa |
| 372 | template<typename T, typename U> |
| 373 | void test_attach27(T aaa, U bbb); |
| 374 | |
| 375 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 376 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
| 377 | /// \brief\brief Aaa |
| 378 | /// \tparam T Aaa |
| 379 | template<> |
| 380 | void test_attach27(int aaa, int bbb); |
| 381 | |
| 382 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 383 | /// \brief\brief Aaa |
| 384 | /// \tparam T Aaa |
| 385 | template<typename T> |
| 386 | class test_attach28 { |
| 387 | T aaa; |
| 388 | }; |
| 389 | |
| 390 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 391 | /// \brief\brief Aaa |
| 392 | /// \tparam T Aaa |
| 393 | template<typename T, typename U> |
| 394 | class test_attach29 { }; |
| 395 | |
| 396 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 397 | /// \brief\brief Aaa |
| 398 | /// \tparam T Aaa |
| 399 | template<typename T> |
| 400 | class test_attach29<T, int> { }; |
| 401 | |
| 402 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 403 | /// \brief\brief Aaa |
| 404 | template<> |
| 405 | class test_attach29<int, int> { }; |
| 406 | |
| 407 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 408 | /// \brief\brief Aaa |
| 409 | /// \tparam T Aaa |
| 410 | template<typename T, typename U, typename V> |
| 411 | class test_attach30 { }; |
| 412 | |
| 413 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 414 | /// \brief\brief Aaa |
| 415 | /// \tparam T Aaa |
| 416 | template<typename T, typename U> |
| 417 | class test_attach30<T, U, int> { }; |
| 418 | |
| 419 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 420 | /// \brief\brief Aaa |
| 421 | /// \tparam T Aaa |
| 422 | template<typename T> |
| 423 | class test_attach30<T, int, int> { }; |
| 424 | |
| 425 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 426 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
| 427 | /// \brief\brief Aaa |
| 428 | /// \tparam T Aaa |
| 429 | template<> |
| 430 | class test_attach30<int, int, int> { }; |
| 431 | |
| 432 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 433 | /// \brief\brief Aaa |
| 434 | class test_attach31 { |
| 435 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 436 | /// \brief\brief Aaa |
| 437 | /// \tparam T Aaa |
| 438 | template<typename T, typename U> |
| 439 | void test_attach32(T aaa, U bbb); |
| 440 | }; |
| 441 | |
| 442 | template<typename T> |
| 443 | class test_attach33 { |
| 444 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 445 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
| 446 | /// \brief\brief Aaa |
| 447 | /// \tparam T Aaa |
| 448 | template<typename TT, typename UU> |
| 449 | void test_attach34(TT aaa, UU bbb); |
| 450 | }; |
| 451 | |
| 452 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 453 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
| 454 | /// \brief\brief Aaa |
| 455 | /// \tparam T Aaa |
| 456 | template<> template<> |
| 457 | void test_attach33<int>::test_attach34(int aaa, int bbb) {} |
| 458 | |
| 459 | template<typename T> |
| 460 | class test_attach35 { |
| 461 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 462 | // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}} |
| 463 | /// \brief\brief Aaa |
| 464 | /// \tparam T Aaa |
| 465 | void test_attach36(int aaa, int bbb); |
| 466 | }; |
| 467 | |
| 468 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 469 | /// \brief\brief Aaa |
| 470 | /// \tparam T Aaa |
| 471 | template<typename T> |
| 472 | void test_attach35<T>::test_attach36(int aaa, int bbb) {} |
| 473 | |
| 474 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 475 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
| 476 | /// \brief\brief Aaa |
| 477 | /// \tparam T Aaa |
| 478 | template<> |
| 479 | void test_attach35<int>::test_attach36(int aaa, int bbb) {} |
| 480 | |
| 481 | |
Dmitri Gribenko | 9f08f49 | 2012-07-20 20:18:53 +0000 | [diff] [blame] | 482 | // PR13411, reduced. We used to crash on this. |
| 483 | /** |
| 484 | * @code Aaa. |
| 485 | */ |
| 486 | void test_nocrash1(int); |
| 487 | |
Dmitri Gribenko | e5deb79 | 2012-07-30 18:05:28 +0000 | [diff] [blame] | 488 | // We used to crash on this. |
| 489 | // expected-warning@+2 {{empty paragraph passed to '\param' command}} |
| 490 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 491 | /// \param\brief |
| 492 | void test_nocrash2(int); |
| 493 | |