Fariborz Jahanian | aa9b280 | 2013-05-08 22:14:28 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -fcomment-block-commands=foobar -verify %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s |
Dmitri Gribenko | fae2e4e | 2012-08-01 23:27:13 +0000 | [diff] [blame] | 3 | |
Dmitri Gribenko | b0ddb66 | 2012-08-01 23:29:52 +0000 | [diff] [blame] | 4 | // expected-warning@+1 {{parameter 'ZZZZZZZZZZ' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}} |
| 5 | /// \param ZZZZZZZZZZ Blah blah. |
Dmitri Gribenko | fae2e4e | 2012-08-01 23:27:13 +0000 | [diff] [blame] | 6 | int test1(int a); |
| 7 | |
Dmitri Gribenko | b0ddb66 | 2012-08-01 23:29:52 +0000 | [diff] [blame] | 8 | // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}} |
| 9 | /// \param aab Blah blah. |
Dmitri Gribenko | fae2e4e | 2012-08-01 23:27:13 +0000 | [diff] [blame] | 10 | int test2(int aaa, int bbb); |
| 11 | |
| 12 | // expected-warning@+1 {{template parameter 'ZZZZZZZZZZ' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}} |
| 13 | /// \tparam ZZZZZZZZZZ Aaa |
| 14 | template<typename T> |
| 15 | void test3(T aaa); |
| 16 | |
| 17 | // expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}} |
| 18 | /// \tparam SomTy Aaa |
| 19 | /// \tparam OtherTy Bbb |
| 20 | template<typename SomeTy, typename OtherTy> |
| 21 | void test4(SomeTy aaa, OtherTy bbb); |
| 22 | |
Dmitri Gribenko | 1da8886 | 2012-09-22 21:47:50 +0000 | [diff] [blame] | 23 | // expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}} |
| 24 | /// \deprecated |
| 25 | void test_deprecated_1(); |
| 26 | |
| 27 | // expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}} |
| 28 | /// \deprecated |
| 29 | void test_deprecated_2(int a); |
| 30 | |
| 31 | struct test_deprecated_3 { |
| 32 | // expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}} |
| 33 | /// \deprecated |
| 34 | void test_deprecated_4(); |
| 35 | |
| 36 | // expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}} |
| 37 | /// \deprecated |
| 38 | void test_deprecated_5() { |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | template<typename T> |
| 43 | struct test_deprecated_6 { |
| 44 | // expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}} |
| 45 | /// \deprecated |
| 46 | void test_deprecated_7(); |
| 47 | |
| 48 | // expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}} |
| 49 | /// \deprecated |
| 50 | void test_deprecated_8() { |
| 51 | } |
| 52 | }; |
| 53 | |
Dmitri Gribenko | 6743e04 | 2012-09-29 11:40:46 +0000 | [diff] [blame] | 54 | #define MY_ATTR_DEPRECATED __attribute__((deprecated)) |
| 55 | |
| 56 | // expected-warning@+1 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}} expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}} |
| 57 | /// \deprecated |
| 58 | void test_deprecated_9(int a); |
| 59 | |
Fariborz Jahanian | 6c7a166 | 2013-05-08 19:21:00 +0000 | [diff] [blame] | 60 | // rdar://12381408 |
| 61 | // expected-warning@+2 {{unknown command tag name 'retur'; did you mean 'return'?}} |
| 62 | /// \brief testing fixit |
| 63 | /// \retur int in FooBar |
| 64 | int FooBar(); |
| 65 | |
Fariborz Jahanian | aa9b280 | 2013-05-08 22:14:28 +0000 | [diff] [blame] | 66 | // expected-warning@+1 {{unknown command tag name 'fooba'; did you mean 'foobar'?}} |
| 67 | /// \fooba bbb IS_DOXYGEN_END |
| 68 | int gorf(); |
| 69 | |
Fariborz Jahanian | e46dd48 | 2013-05-09 16:22:31 +0000 | [diff] [blame] | 70 | /// \t bbb IS_DOXYGEN_END |
| 71 | int Bar(); |
| 72 | |
Benjamin Kramer | 2dece57 | 2013-12-01 15:09:32 +0000 | [diff] [blame] | 73 | // expected-warning@+2 {{unknown command tag name 'encode'; did you mean 'endcode'?}} |
| 74 | // expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}} |
| 75 | /// \encode PR18051 |
| 76 | int PR18051(); |
| 77 | |
Dmitri Gribenko | b0ddb66 | 2012-08-01 23:29:52 +0000 | [diff] [blame] | 78 | // CHECK: fix-it:"{{.*}}":{5:12-5:22}:"a" |
| 79 | // CHECK: fix-it:"{{.*}}":{9:12-9:15}:"aaa" |
| 80 | // CHECK: fix-it:"{{.*}}":{13:13-13:23}:"T" |
| 81 | // CHECK: fix-it:"{{.*}}":{18:13-18:18}:"SomeTy" |
Dmitri Gribenko | 1da8886 | 2012-09-22 21:47:50 +0000 | [diff] [blame] | 82 | // CHECK: fix-it:"{{.*}}":{25:25-25:25}:" __attribute__((deprecated))" |
| 83 | // CHECK: fix-it:"{{.*}}":{29:30-29:30}:" __attribute__((deprecated))" |
| 84 | // CHECK: fix-it:"{{.*}}":{34:27-34:27}:" __attribute__((deprecated))" |
| 85 | // CHECK: fix-it:"{{.*}}":{38:27-38:27}:" __attribute__((deprecated))" |
| 86 | // CHECK: fix-it:"{{.*}}":{46:27-46:27}:" __attribute__((deprecated))" |
| 87 | // CHECK: fix-it:"{{.*}}":{50:27-50:27}:" __attribute__((deprecated))" |
Dmitri Gribenko | 6743e04 | 2012-09-29 11:40:46 +0000 | [diff] [blame] | 88 | // CHECK: fix-it:"{{.*}}":{58:30-58:30}:" MY_ATTR_DEPRECATED" |
Fariborz Jahanian | 6c7a166 | 2013-05-08 19:21:00 +0000 | [diff] [blame] | 89 | // CHECK: fix-it:"{{.*}}":{63:6-63:11}:"return" |
Fariborz Jahanian | aa9b280 | 2013-05-08 22:14:28 +0000 | [diff] [blame] | 90 | // CHECK: fix-it:"{{.*}}":{67:6-67:11}:"foobar" |
Benjamin Kramer | 2dece57 | 2013-12-01 15:09:32 +0000 | [diff] [blame] | 91 | // CHECK: fix-it:"{{.*}}":{75:6-75:12}:"endcode" |