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