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