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