1 // RUN: %clang_cc1 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -verify %s
2 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck -DATTRIBUTE="__attribute__((deprecated))" %s
3 // RUN: %clang_cc1 -std=c++14 -fsyntax-only -Wdocumentation -Wdocumentation-pedantic -fcomment-block-commands=foobar -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck --check-prefixes=CHECK,CHECK14 -DATTRIBUTE="[[deprecated]]" %s
5 // expected-warning@+1 {{parameter 'ZZZZZZZZZZ' not found in the function declaration}} expected-note@+1 {{did you mean 'a'?}}
6 /// \param ZZZZZZZZZZ Blah blah.
9 // expected-warning@+1 {{parameter 'aab' not found in the function declaration}} expected-note@+1 {{did you mean 'aaa'?}}
10 /// \param aab Blah blah.
11 int test2(int aaa
, int bbb
);
13 // expected-warning@+1 {{template parameter 'ZZZZZZZZZZ' not found in the template declaration}} expected-note@+1 {{did you mean 'T'?}}
14 /// \tparam ZZZZZZZZZZ Aaa
18 // expected-warning@+1 {{template parameter 'SomTy' not found in the template declaration}} expected-note@+1 {{did you mean 'SomeTy'?}}
20 /// \tparam OtherTy Bbb
21 template<typename SomeTy
, typename OtherTy
>
22 void test4(SomeTy aaa
, OtherTy bbb
);
24 // 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}}
26 void test_deprecated_1();
28 // 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}}
30 void test_deprecated_2(int a
);
32 struct test_deprecated_3
{
33 // 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}}
35 void test_deprecated_4();
37 // 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}}
39 void test_deprecated_5() {
44 struct test_deprecated_6
{
45 // 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}}
47 void test_deprecated_7();
49 // 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}}
51 void test_deprecated_8() {
56 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
57 // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
59 static void test_deprecated_static();
61 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
62 // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
64 static auto test_deprecated_static_trailing_return() -> int;
66 #if __cplusplus >= 201402L
67 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
68 // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
70 static decltype(auto) test_deprecated_static_decltype_auto() { return 1; }
73 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
74 // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
76 void test_deprecated_const() const;
78 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
79 // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
81 auto test_deprecated_trailing_return() -> int;
83 #if __cplusplus >= 201402L
84 // expected-warning@+2 {{declaration is marked with '\deprecated' command but does not have a deprecation attribute}}
85 // expected-note@+2 {{add a deprecation attribute to the declaration to silence this warning}}
87 decltype(auto) test_deprecated_decltype_auto() const { return a
; }
93 #define MY_ATTR_DEPRECATED __attribute__((deprecated))
95 // 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}}
97 void test_deprecated_9(int a
);
99 #if __cplusplus >= 201402L
100 #define ATTRIBUTE_DEPRECATED [[deprecated]]
102 // 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}}
104 void test_deprecated_10(int a
);
107 // expected-warning@+2 {{unknown command tag name 'retur'; did you mean 'return'?}}
108 /// \brief testing fixit
109 /// \retur int in FooBar
112 // expected-warning@+1 {{unknown command tag name 'fooba'; did you mean 'foobar'?}}
113 /// \fooba bbb IS_DOXYGEN_END
116 // expected-warning@+1 {{unknown command tag name}}
117 /// \t bbb IS_DOXYGEN_END
120 // expected-warning@+2 {{unknown command tag name 'encode'; did you mean 'endcode'?}}
121 // expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}}
125 // CHECK: fix-it:"{{.*}}":{6:12-6:22}:"a"
126 // CHECK: fix-it:"{{.*}}":{10:12-10:15}:"aaa"
127 // CHECK: fix-it:"{{.*}}":{14:13-14:23}:"T"
128 // CHECK: fix-it:"{{.*}}":{19:13-19:18}:"SomeTy"
129 // CHECK: fix-it:"{{.*}}":{26:1-26:1}:"[[ATTRIBUTE]] "
130 // CHECK: fix-it:"{{.*}}":{30:1-30:1}:"[[ATTRIBUTE]] "
131 // CHECK: fix-it:"{{.*}}":{35:3-35:3}:"[[ATTRIBUTE]] "
132 // CHECK: fix-it:"{{.*}}":{39:3-39:3}:"[[ATTRIBUTE]] "
133 // CHECK: fix-it:"{{.*}}":{47:3-47:3}:"[[ATTRIBUTE]] "
134 // CHECK: fix-it:"{{.*}}":{51:3-51:3}:"[[ATTRIBUTE]] "
135 // CHECK: fix-it:"{{.*}}":{76:3-76:3}:"[[ATTRIBUTE]] "
136 // CHECK: fix-it:"{{.*}}":{81:3-81:3}:"[[ATTRIBUTE]] "
137 // CHECK14: fix-it:"{{.*}}":{87:3-87:3}:"[[ATTRIBUTE]] "
138 // CHECK: fix-it:"{{.*}}":{97:1-97:1}:"MY_ATTR_DEPRECATED "
139 // CHECK14: fix-it:"{{.*}}":{104:1-104:1}:"ATTRIBUTE_DEPRECATED "
140 // CHECK: fix-it:"{{.*}}":{109:6-109:11}:"return"
141 // CHECK: fix-it:"{{.*}}":{113:6-113:11}:"foobar"
142 // CHECK: fix-it:"{{.*}}":{122:6-122:12}:"endcode"