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