Dmitri Gribenko | c27bc80 | 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 | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 2 | |
Dmitri Gribenko | f303d4c | 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 | a5ef44f | 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 | 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 href= blah |
| 18 | int test_html3(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 => |
| 22 | int test_html4(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 "aaa"> |
| 26 | int test_html5(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" => |
| 30 | int test_html6(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" "aaa"> |
| 34 | int test_html7(int); |
| 35 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 36 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 37 | /// <a a="b" = |
| 38 | int test_html8(int); |
| 39 | |
Dmitri Gribenko | 3f38bf2 | 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 | 834a5bd | 2012-08-22 22:56:08 +0000 | [diff] [blame] | 41 | /** Aaa bbb<img ddd eee |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 42 | * fff ggg. |
| 43 | */ |
| 44 | int test_html9(int); |
| 45 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 46 | // expected-warning@+1 {{HTML start tag prematurely ended, expected attribute name or '>'}} |
Dmitri Gribenko | 834a5bd | 2012-08-22 22:56:08 +0000 | [diff] [blame] | 47 | /** Aaa bbb<img ddd eee 42% |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 48 | * fff ggg. |
| 49 | */ |
| 50 | int test_html10(int); |
| 51 | |
Dmitri Gribenko | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 52 | // expected-warning@+1 {{HTML end tag 'br' is forbidden}} |
Dmitri Gribenko | 3d98698 | 2012-07-12 23:37:09 +0000 | [diff] [blame] | 53 | /// <br></br> |
| 54 | int test_html11(int); |
Dmitri Gribenko | a5ef44f | 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 | 3f38bf2 | 2012-07-13 00:44:24 +0000 | [diff] [blame] | 70 | // expected-warning@+1 {{HTML end tag does not match any start tag}} |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 71 | /// <b><i>Meow</a> |
| 72 | int test_html_nesting5(int); |
| 73 | |
Dmitri Gribenko | 3f38bf2 | 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 | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 76 | /// <b><i>Meow</b></b> |
| 77 | int test_html_nesting6(int); |
| 78 | |
Dmitri Gribenko | 3f38bf2 | 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 | a5ef44f | 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 | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 86 | /// \brief\returns Aaa |
Dmitri Gribenko | a5ef44f | 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 | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 90 | /// \brief \returns Aaa |
Dmitri Gribenko | a5ef44f | 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 | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 95 | /// \returns Aaa |
Dmitri Gribenko | a5ef44f | 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 | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 101 | /// \returns Aaa |
Dmitri Gribenko | a5ef44f | 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 | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 108 | /// \returns Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 109 | int test_block_command5(int); |
| 110 | |
Dmitri Gribenko | 858e69f | 2012-07-19 00:01:56 +0000 | [diff] [blame] | 111 | /// \brief \c Aaa |
| 112 | int test_block_command6(int); |
| 113 | |
Dmitri Gribenko | 9443c57 | 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 | |
| 139 | // expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\return' here}} |
| 140 | /// \return Aaa |
| 141 | /// |
| 142 | /// Bbb |
| 143 | /// |
| 144 | /// \return Ccc |
| 145 | int test_duplicate_returns1(int); |
| 146 | |
| 147 | // expected-warning@+5 {{duplicated command '\returns'}} expected-note@+1 {{previous command '\returns' here}} |
| 148 | /// \returns Aaa |
| 149 | /// |
| 150 | /// Bbb |
| 151 | /// |
| 152 | /// \returns Ccc |
| 153 | int test_duplicate_returns2(int); |
| 154 | |
| 155 | // expected-warning@+5 {{duplicated command '\result'}} expected-note@+1 {{previous command '\result' here}} |
| 156 | /// \result Aaa |
| 157 | /// |
| 158 | /// Bbb |
| 159 | /// |
| 160 | /// \result Ccc |
| 161 | int test_duplicate_returns3(int); |
| 162 | |
| 163 | // expected-warning@+5 {{duplicated command '\return'}} expected-note@+1 {{previous command '\returns' (an alias of '\return') here}} |
| 164 | /// \returns Aaa |
| 165 | /// |
| 166 | /// Bbb |
| 167 | /// |
| 168 | /// \return Ccc |
| 169 | int test_duplicate_returns4(int); |
| 170 | |
| 171 | |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 172 | // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}} |
| 173 | /// \param a Blah blah. |
| 174 | int test_param1; |
| 175 | |
| 176 | // expected-warning@+1 {{empty paragraph passed to '\param' command}} |
| 177 | /// \param |
| 178 | /// \param a Blah blah. |
| 179 | int test_param2(int a); |
| 180 | |
| 181 | // expected-warning@+1 {{empty paragraph passed to '\param' command}} |
| 182 | /// \param a |
| 183 | int test_param3(int a); |
| 184 | |
| 185 | /// \param a Blah blah. |
| 186 | int test_param4(int a); |
| 187 | |
| 188 | /// \param [in] a Blah blah. |
| 189 | int test_param5(int a); |
| 190 | |
| 191 | /// \param [out] a Blah blah. |
| 192 | int test_param6(int a); |
| 193 | |
| 194 | /// \param [in,out] a Blah blah. |
| 195 | int test_param7(int a); |
| 196 | |
| 197 | // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}} |
| 198 | /// \param [ in ] a Blah blah. |
| 199 | int test_param8(int a); |
| 200 | |
| 201 | // expected-warning@+1 {{whitespace is not allowed in parameter passing direction}} |
| 202 | /// \param [in, out] a Blah blah. |
| 203 | int test_param9(int a); |
| 204 | |
| 205 | // expected-warning@+1 {{unrecognized parameter passing direction, valid directions are '[in]', '[out]' and '[in,out]'}} |
| 206 | /// \param [ junk] a Blah blah. |
| 207 | int test_param10(int a); |
| 208 | |
Dmitri Gribenko | 2e72104 | 2012-07-24 21:56:59 +0000 | [diff] [blame] | 209 | // expected-warning@+1 {{parameter 'a' not found in the function declaration}} |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 210 | /// \param a Blah blah. |
| 211 | int test_param11(); |
| 212 | |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 213 | // expected-warning@+1 {{parameter 'A' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}} |
| 214 | /// \param A Blah blah. |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 215 | int test_param12(int a); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 216 | |
| 217 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}} |
| 218 | /// \param aab Blah blah. |
Dmitri Gribenko | 56bf6fd | 2012-07-24 21:46:24 +0000 | [diff] [blame] | 219 | int test_param13(int aaa, int bbb); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 220 | |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 221 | // expected-warning@+2 {{parameter 'aab' not found in the function declaration}} expected-note@+2 {{did you mean 'bbb'?}} |
| 222 | /// \param aaa Blah blah. |
| 223 | /// \param aab Blah blah. |
| 224 | int test_param14(int aaa, int bbb); |
| 225 | |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 226 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} |
| 227 | /// \param aab Blah blah. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 228 | int test_param15(int bbb, int ccc); |
| 229 | |
| 230 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} |
| 231 | /// \param aab Ccc. |
| 232 | /// \param aaa Aaa. |
| 233 | /// \param bbb Bbb. |
| 234 | int test_param16(int aaa, int bbb); |
| 235 | |
| 236 | // expected-warning@+2 {{parameter 'aab' not found in the function declaration}} |
| 237 | /// \param aaa Aaa. |
| 238 | /// \param aab Ccc. |
| 239 | /// \param bbb Bbb. |
| 240 | int test_param17(int aaa, int bbb); |
| 241 | |
| 242 | // expected-warning@+3 {{parameter 'aab' not found in the function declaration}} |
| 243 | /// \param aaa Aaa. |
| 244 | /// \param bbb Bbb. |
| 245 | /// \param aab Ccc. |
| 246 | int test_param18(int aaa, int bbb); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 247 | |
| 248 | class C { |
| 249 | // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}} |
| 250 | /// \param aaa Blah blah. |
| 251 | C(int bbb, int ccc); |
| 252 | |
| 253 | // expected-warning@+1 {{parameter 'aaa' not found in the function declaration}} |
| 254 | /// \param aaa Blah blah. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 255 | int test_param19(int bbb, int ccc); |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 256 | }; |
| 257 | |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 258 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} |
| 259 | /// \param aab Blah blah. |
| 260 | template<typename T> |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 261 | void test_param20(int bbb, int ccc); |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 262 | |
Dmitri Gribenko | 6582277 | 2012-07-24 21:44:16 +0000 | [diff] [blame] | 263 | // expected-warning@+3 {{parameter 'a' is already documented}} |
| 264 | // expected-note@+1 {{previous documentation}} |
| 265 | /// \param a Aaa. |
| 266 | /// \param a Aaa. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 267 | int test_param21(int a); |
Dmitri Gribenko | 6582277 | 2012-07-24 21:44:16 +0000 | [diff] [blame] | 268 | |
| 269 | // expected-warning@+4 {{parameter 'x2' is already documented}} |
| 270 | // expected-note@+2 {{previous documentation}} |
| 271 | /// \param x1 Aaa. |
| 272 | /// \param x2 Bbb. |
| 273 | /// \param x2 Ccc. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 274 | int test_param22(int x1, int x2, int x3); |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 275 | |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 276 | // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 277 | /// \param aaa Meow. |
| 278 | /// \param bbb Bbb. |
| 279 | /// \returns aaa. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 280 | typedef int test_param23(int aaa, int ccc); |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 281 | |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 282 | // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 283 | /// \param aaa Meow. |
| 284 | /// \param bbb Bbb. |
| 285 | /// \returns aaa. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 286 | typedef int (*test_param24)(int aaa, int ccc); |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 287 | |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 288 | // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 289 | /// \param aaa Meow. |
| 290 | /// \param bbb Bbb. |
| 291 | /// \returns aaa. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 292 | typedef int (* const test_param25)(int aaa, int ccc); |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 293 | |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 294 | // expected-warning@+2 {{parameter 'bbb' not found in the function declaration}} expected-note@+2 {{did you mean 'ccc'?}} |
Dmitri Gribenko | 70ff109 | 2012-08-24 00:05:30 +0000 | [diff] [blame] | 295 | /// \param aaa Meow. |
| 296 | /// \param bbb Bbb. |
| 297 | /// \returns aaa. |
Dmitri Gribenko | 9edd2c8 | 2012-08-24 17:45:39 +0000 | [diff] [blame] | 298 | typedef int (C::*test_param26)(int aaa, int ccc); |
| 299 | |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 300 | |
| 301 | // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}} |
| 302 | /// \tparam T Aaa |
| 303 | int test_tparam1; |
| 304 | |
| 305 | // expected-warning@+1 {{'\tparam' command used in a comment that is not attached to a template declaration}} |
| 306 | /// \tparam T Aaa |
| 307 | void test_tparam2(int aaa); |
| 308 | |
| 309 | // expected-warning@+1 {{empty paragraph passed to '\tparam' command}} |
| 310 | /// \tparam |
| 311 | /// \param aaa Blah blah |
| 312 | template<typename T> |
| 313 | void test_tparam3(T aaa); |
| 314 | |
| 315 | // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}} |
| 316 | /// \tparam T Aaa |
| 317 | template<typename TT> |
| 318 | void test_tparam4(TT aaa); |
| 319 | |
| 320 | // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TT'?}} |
| 321 | /// \tparam T Aaa |
| 322 | template<typename TT> |
| 323 | class test_tparam5 { |
| 324 | // expected-warning@+1 {{template parameter 'T' not found in the template declaration}} expected-note@+1 {{did you mean 'TTT'?}} |
| 325 | /// \tparam T Aaa |
| 326 | template<typename TTT> |
| 327 | void test_tparam6(TTT aaa); |
| 328 | }; |
| 329 | |
| 330 | /// \tparam T1 Aaa |
| 331 | /// \tparam T2 Bbb |
| 332 | template<typename T1, typename T2> |
| 333 | void test_tparam7(T1 aaa, T2 bbb); |
| 334 | |
| 335 | // expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}} |
| 336 | /// \tparam SomTy Aaa |
| 337 | /// \tparam OtherTy Bbb |
| 338 | template<typename SomeTy, typename OtherTy> |
| 339 | void test_tparam8(SomeTy aaa, OtherTy bbb); |
| 340 | |
| 341 | // expected-warning@+2 {{template parameter 'T1' is already documented}} expected-note@+1 {{previous documentation}} |
| 342 | /// \tparam T1 Aaa |
| 343 | /// \tparam T1 Bbb |
| 344 | template<typename T1, typename T2> |
| 345 | void test_tparam9(T1 aaa, T2 bbb); |
| 346 | |
| 347 | /// \tparam T Aaa |
| 348 | /// \tparam TT Bbb |
| 349 | template<template<typename T> class TT> |
| 350 | void test_tparam10(TT<int> aaa); |
| 351 | |
| 352 | /// \tparam T Aaa |
| 353 | /// \tparam TT Bbb |
| 354 | /// \tparam TTT Ccc |
| 355 | template<template<template<typename T> class TT, class C> class TTT> |
| 356 | void test_tparam11(); |
| 357 | |
| 358 | /// \tparam I Aaa |
| 359 | template<int I> |
| 360 | void test_tparam12(); |
| 361 | |
Dmitri Gribenko | 967e5d7 | 2012-08-02 21:36:57 +0000 | [diff] [blame] | 362 | template<typename T, typename U> |
| 363 | class test_tparam13 { }; |
| 364 | |
| 365 | /// \tparam T Aaa |
| 366 | template<typename T> |
| 367 | using test_tparam14 = test_tparam13<T, int>; |
| 368 | |
| 369 | // expected-warning@+1 {{template parameter 'U' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}} |
| 370 | /// \tparam U Aaa |
| 371 | template<typename T> |
| 372 | using test_tparam15 = test_tparam13<T, int>; |
| 373 | |
Dmitri Gribenko | abcf0dc | 2012-09-13 20:36:01 +0000 | [diff] [blame^] | 374 | |
| 375 | /// Aaa |
| 376 | /// \deprecated Bbb |
| 377 | void test_deprecated_1(int a); |
| 378 | |
| 379 | // We don't want \deprecated to warn about empty paragraph. It is fine to use |
| 380 | // \deprecated by itself without explanations. |
| 381 | |
| 382 | /// Aaa |
| 383 | /// \deprecated |
| 384 | void test_deprecated_2(int a); |
| 385 | |
| 386 | |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 387 | // no-warning |
| 388 | /// \returns Aaa |
| 389 | int test_returns_right_decl_1(int); |
| 390 | |
| 391 | class test_returns_right_decl_2 { |
| 392 | // no-warning |
| 393 | /// \returns Aaa |
| 394 | int test_returns_right_decl_3(int); |
| 395 | }; |
| 396 | |
| 397 | // no-warning |
| 398 | /// \returns Aaa |
| 399 | template<typename T> |
| 400 | int test_returns_right_decl_4(T aaa); |
| 401 | |
| 402 | // no-warning |
| 403 | /// \returns Aaa |
| 404 | template<> |
| 405 | int test_returns_right_decl_4(int aaa); |
| 406 | |
| 407 | /// \returns Aaa |
| 408 | template<typename T> |
| 409 | T test_returns_right_decl_5(T aaa); |
| 410 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 411 | // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 412 | /// \returns Aaa |
| 413 | int test_returns_wrong_decl_1; |
| 414 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 415 | // expected-warning@+1 {{'\return' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 416 | /// \return Aaa |
| 417 | int test_returns_wrong_decl_2; |
| 418 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 419 | // expected-warning@+1 {{'\result' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 420 | /// \result Aaa |
| 421 | int test_returns_wrong_decl_3; |
| 422 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 423 | // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 424 | /// \returns Aaa |
| 425 | void test_returns_wrong_decl_4(int); |
| 426 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 427 | // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 428 | /// \returns Aaa |
| 429 | template<typename T> |
| 430 | void test_returns_wrong_decl_5(T aaa); |
| 431 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 432 | // expected-warning@+1 {{'\returns' command used in a comment that is attached to a function returning void}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 433 | /// \returns Aaa |
| 434 | template<> |
| 435 | void test_returns_wrong_decl_5(int aaa); |
| 436 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 437 | // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 438 | /// \returns Aaa |
| 439 | struct test_returns_wrong_decl_6 { }; |
| 440 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 441 | // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 442 | /// \returns Aaa |
| 443 | class test_returns_wrong_decl_7 { |
| 444 | // expected-warning@+1 {{'\returns' command used in a comment that is attached to a constructor}} |
| 445 | /// \returns Aaa |
| 446 | test_returns_wrong_decl_7(); |
| 447 | |
| 448 | // expected-warning@+1 {{'\returns' command used in a comment that is attached to a destructor}} |
| 449 | /// \returns Aaa |
| 450 | ~test_returns_wrong_decl_7(); |
| 451 | }; |
| 452 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 453 | // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 454 | /// \returns Aaa |
| 455 | enum test_returns_wrong_decl_8 { |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 456 | // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 457 | /// \returns Aaa |
| 458 | test_returns_wrong_decl_9 |
| 459 | }; |
| 460 | |
Dmitri Gribenko | 88815f3 | 2012-08-06 16:29:26 +0000 | [diff] [blame] | 461 | // expected-warning@+1 {{'\returns' command used in a comment that is not attached to a function or method declaration}} |
Dmitri Gribenko | 89ab7d0 | 2012-08-03 21:15:32 +0000 | [diff] [blame] | 462 | /// \returns Aaa |
| 463 | namespace test_returns_wrong_decl_10 { }; |
| 464 | |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 465 | |
| 466 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 467 | int test1; ///< \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 468 | |
| 469 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 470 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 471 | int test2, ///< \brief\author Aaa |
| 472 | test3; ///< \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 473 | |
| 474 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 475 | int test4; ///< \brief |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 476 | ///< \author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 477 | |
| 478 | |
| 479 | // Check that we attach the comment to the declaration during parsing in the |
| 480 | // following cases. The test is based on the fact that we don't parse |
| 481 | // documentation comments that are not attached to anything. |
| 482 | |
| 483 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 484 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 485 | int test_attach1; |
| 486 | |
| 487 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 488 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 489 | int test_attach2(int); |
| 490 | |
| 491 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 492 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 493 | struct test_attach3 { |
| 494 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 495 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 496 | int test_attach4; |
| 497 | |
| 498 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 499 | int test_attach5; ///< \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 500 | |
| 501 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 502 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 503 | int test_attach6(int); |
| 504 | }; |
| 505 | |
| 506 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 507 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 508 | class test_attach7 { |
| 509 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 510 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 511 | int test_attach8; |
| 512 | |
| 513 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 514 | int test_attach9; ///< \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 515 | |
| 516 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 517 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 518 | int test_attach10(int); |
| 519 | }; |
| 520 | |
| 521 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 522 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 523 | enum test_attach9 { |
| 524 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 525 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 526 | test_attach10, |
| 527 | |
| 528 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 529 | test_attach11 ///< \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 530 | }; |
| 531 | |
| 532 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 533 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 534 | struct test_noattach12 *test_attach13; |
| 535 | |
| 536 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 537 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 538 | typedef struct test_noattach14 *test_attach15; |
| 539 | |
| 540 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 541 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 542 | typedef struct test_attach16 { int a; } test_attach17; |
| 543 | |
| 544 | struct S { int a; }; |
| 545 | |
| 546 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 547 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 548 | struct S *test_attach18; |
| 549 | |
| 550 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 551 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 552 | typedef struct S *test_attach19; |
| 553 | |
| 554 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 555 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 556 | struct test_attach20; |
| 557 | |
| 558 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 559 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 560 | typedef struct test_attach21 { |
| 561 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 562 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 563 | int test_attach22; |
| 564 | } test_attach23; |
| 565 | |
| 566 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 567 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 568 | namespace test_attach24 { |
| 569 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 570 | /// \brief\author Aaa |
Dmitri Gribenko | a5ef44f | 2012-07-11 21:38:39 +0000 | [diff] [blame] | 571 | namespace test_attach25 { |
| 572 | } |
| 573 | } |
| 574 | |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 575 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 576 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 577 | /// \tparam T Aaa |
| 578 | template<typename T> |
| 579 | void test_attach26(T aaa); |
| 580 | |
| 581 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 582 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 583 | /// \tparam T Aaa |
| 584 | template<typename T, typename U> |
| 585 | void test_attach27(T aaa, U bbb); |
| 586 | |
| 587 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 588 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 589 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 590 | /// \tparam T Aaa |
| 591 | template<> |
| 592 | void test_attach27(int aaa, int bbb); |
| 593 | |
| 594 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 595 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 596 | /// \tparam T Aaa |
| 597 | template<typename T> |
| 598 | class test_attach28 { |
| 599 | T aaa; |
| 600 | }; |
| 601 | |
| 602 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 603 | /// \brief\author Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 604 | using test_attach29 = test_attach28<int>; |
| 605 | |
| 606 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 607 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 608 | /// \tparam T Aaa |
| 609 | template<typename T, typename U> |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 610 | class test_attach30 { }; |
| 611 | |
| 612 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 613 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 614 | /// \tparam T Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 615 | template<typename T> |
| 616 | class test_attach30<T, int> { }; |
| 617 | |
| 618 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 619 | /// \brief\author Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 620 | template<> |
| 621 | class test_attach30<int, int> { }; |
| 622 | |
| 623 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 624 | /// \brief\author Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 625 | template<typename T> |
| 626 | using test_attach31 = test_attach30<T, int>; |
| 627 | |
| 628 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 629 | /// \brief\author Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 630 | /// \tparam T Aaa |
| 631 | template<typename T, typename U, typename V> |
| 632 | class test_attach32 { }; |
| 633 | |
| 634 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 635 | /// \brief\author Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 636 | /// \tparam T Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 637 | template<typename T, typename U> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 638 | class test_attach32<T, U, int> { }; |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 639 | |
| 640 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 641 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 642 | /// \tparam T Aaa |
| 643 | template<typename T> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 644 | class test_attach32<T, int, int> { }; |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 645 | |
| 646 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 647 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 648 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 649 | /// \tparam T Aaa |
| 650 | template<> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 651 | class test_attach32<int, int, int> { }; |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 652 | |
| 653 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 654 | /// \brief\author Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 655 | class test_attach33 { |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 656 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 657 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 658 | /// \tparam T Aaa |
| 659 | template<typename T, typename U> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 660 | void test_attach34(T aaa, U bbb); |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 661 | }; |
| 662 | |
| 663 | template<typename T> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 664 | class test_attach35 { |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 665 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 666 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 667 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 668 | /// \tparam T Aaa |
| 669 | template<typename TT, typename UU> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 670 | void test_attach36(TT aaa, UU bbb); |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 671 | }; |
| 672 | |
| 673 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 674 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 675 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 676 | /// \tparam T Aaa |
| 677 | template<> template<> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 678 | void test_attach35<int>::test_attach36(int aaa, int bbb) {} |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 679 | |
| 680 | template<typename T> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 681 | class test_attach37 { |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 682 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 683 | // expected-warning@+2 {{'\tparam' command used in a comment that is not attached to a template declaration}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 684 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 685 | /// \tparam T Aaa |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 686 | void test_attach38(int aaa, int bbb); |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 687 | |
Dmitri Gribenko | c41ace9 | 2012-08-14 17:17:18 +0000 | [diff] [blame] | 688 | void test_attach39(int aaa, int bbb); |
| 689 | }; |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 690 | |
| 691 | // expected-warning@+2 {{empty paragraph passed to '\brief' command}} |
| 692 | // expected-warning@+2 {{template parameter 'T' not found in the template declaration}} |
Dmitri Gribenko | 9443c57 | 2012-08-06 17:08:27 +0000 | [diff] [blame] | 693 | /// \brief\author Aaa |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 694 | /// \tparam T Aaa |
| 695 | template<> |
Dmitri Gribenko | c27bc80 | 2012-08-02 20:49:51 +0000 | [diff] [blame] | 696 | void test_attach37<int>::test_attach38(int aaa, int bbb) {} |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 697 | |
Dmitri Gribenko | c41ace9 | 2012-08-14 17:17:18 +0000 | [diff] [blame] | 698 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 699 | /// \brief\author Aaa |
| 700 | /// \tparam T Aaa |
| 701 | template<typename T> |
| 702 | void test_attach37<T>::test_attach39(int aaa, int bbb) {} |
| 703 | |
Dmitri Gribenko | 1599eac | 2012-08-16 18:19:43 +0000 | [diff] [blame] | 704 | // We used to emit warning that parameter 'a' is not found because we parsed |
| 705 | // the comment in context of the redeclaration which does not have parameter |
| 706 | // names. |
| 707 | template <typename T> |
| 708 | struct test_attach38 { |
| 709 | /*! |
| 710 | \param a First param |
| 711 | \param b Second param |
| 712 | */ |
| 713 | template <typename B> |
| 714 | void test_attach39(T a, B b); |
| 715 | }; |
| 716 | |
| 717 | template <> |
| 718 | template <typename B> |
| 719 | void test_attach38<int>::test_attach39(int, B); |
Dmitri Gribenko | c41ace9 | 2012-08-14 17:17:18 +0000 | [diff] [blame] | 720 | |
Dmitri Gribenko | 96b0986 | 2012-07-31 22:37:06 +0000 | [diff] [blame] | 721 | |
Dmitri Gribenko | 9f08f49 | 2012-07-20 20:18:53 +0000 | [diff] [blame] | 722 | // PR13411, reduced. We used to crash on this. |
| 723 | /** |
| 724 | * @code Aaa. |
| 725 | */ |
| 726 | void test_nocrash1(int); |
| 727 | |
Dmitri Gribenko | e5deb79 | 2012-07-30 18:05:28 +0000 | [diff] [blame] | 728 | // We used to crash on this. |
| 729 | // expected-warning@+2 {{empty paragraph passed to '\param' command}} |
| 730 | // expected-warning@+1 {{empty paragraph passed to '\brief' command}} |
| 731 | /// \param\brief |
| 732 | void test_nocrash2(int); |
| 733 | |
Dmitri Gribenko | c41ace9 | 2012-08-14 17:17:18 +0000 | [diff] [blame] | 734 | // PR13593, example 1 and 2 |
Douglas Gregor | cd81df2 | 2012-08-13 16:37:30 +0000 | [diff] [blame] | 735 | |
| 736 | /** |
| 737 | * Bla. |
| 738 | */ |
| 739 | template <typename> |
| 740 | void test_nocrash3(); |
| 741 | |
| 742 | /// Foo |
| 743 | template <typename, typename> |
| 744 | void test_nocrash4() { } |
| 745 | |
| 746 | template <typename> |
| 747 | void test_nocrash3() |
| 748 | { |
| 749 | } |
Dmitri Gribenko | c41ace9 | 2012-08-14 17:17:18 +0000 | [diff] [blame] | 750 | |
| 751 | // PR13593, example 3 |
| 752 | |
| 753 | /** |
| 754 | * aaa |
| 755 | */ |
| 756 | template <typename T> |
| 757 | inline T test_nocrash5(T a1) |
| 758 | { |
| 759 | return a1; |
| 760 | } |
| 761 | |
| 762 | /// |
| 763 | //, |
| 764 | |
| 765 | inline void test_nocrash6() |
| 766 | { |
| 767 | test_nocrash5(1); |
| 768 | } |
| 769 | |
| 770 | // We used to crash on this. |
| 771 | |
| 772 | /*! |
| 773 | Blah. |
| 774 | */ |
| 775 | typedef const struct test_nocrash7 * test_nocrash8; |
| 776 | |
Dmitri Gribenko | b0b8a96 | 2012-09-11 19:22:03 +0000 | [diff] [blame] | 777 | // We used to crash on this. |
| 778 | |
| 779 | /// aaa \unknown aaa \unknown aaa |
| 780 | int test_nocrash9; |
| 781 | |