blob: 9e16b331c23c834113e4ebdba4e3299f98326f85 [file] [log] [blame]
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2// rdar://8769853
3
4@interface B
5- (void) depInA;
John McCallf85e1932011-06-15 23:02:42 +00006- (void) unavailMeth __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
Stephen Hines651f13c2014-04-23 16:59:28 -07007- (void) depInA1 __attribute__((deprecated)); // expected-note {{'depInA1' has been explicitly marked deprecated here}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +00008- (void) unavailMeth1;
Stephen Hines651f13c2014-04-23 16:59:28 -07009- (void) depInA2 __attribute__((deprecated)); // expected-note {{'depInA2' has been explicitly marked deprecated here}}
John McCallf85e1932011-06-15 23:02:42 +000010- (void) unavailMeth2 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +000011- (void) depunavailInA;
John McCallf85e1932011-06-15 23:02:42 +000012- (void) depunavailInA1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
Stephen Hines651f13c2014-04-23 16:59:28 -070013- (void)FuzzyMeth __attribute__((deprecated)); // expected-note {{'FuzzyMeth' has been explicitly marked deprecated here}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +000014- (void)FuzzyMeth1 __attribute__((unavailable));
15@end
16
17@interface A
John McCallf85e1932011-06-15 23:02:42 +000018- (void) unavailMeth1 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
Stephen Hines651f13c2014-04-23 16:59:28 -070019- (void) depInA __attribute__((deprecated)); // expected-note {{'depInA' has been explicitly marked deprecated here}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +000020- (void) depInA2 __attribute__((deprecated));
21- (void) depInA1;
22- (void) unavailMeth2 __attribute__((unavailable));
John McCallf85e1932011-06-15 23:02:42 +000023- (void) depunavailInA __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +000024- (void) depunavailInA1;
25- (void)FuzzyMeth __attribute__((unavailable));
Stephen Hines651f13c2014-04-23 16:59:28 -070026- (void)FuzzyMeth1 __attribute__((deprecated)); // expected-note {{'FuzzyMeth1' has been explicitly marked deprecated here}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +000027@end
28
29
Stephen Hines651f13c2014-04-23 16:59:28 -070030@class C; // expected-note 10 {{forward declaration of class here}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +000031
32void test(C *c) {
Stephen Hines651f13c2014-04-23 16:59:28 -070033 [c depInA]; // expected-warning {{'depInA' may be deprecated because the receiver type is unknown}}
34 [c unavailMeth]; // expected-warning {{'unavailMeth' may be unavailable because the receiver type is unknown}}
35 [c depInA1]; // expected-warning {{'depInA1' may be deprecated because the receiver type is unknown}}
36 [c unavailMeth1]; // expected-warning {{'unavailMeth1' may be unavailable because the receiver type is unknown}}
37 [c depInA2]; // expected-warning {{'depInA2' may be deprecated because the receiver type is unknown}}
38 [c unavailMeth2]; // expected-warning {{'unavailMeth2' may be unavailable because the receiver type is unknown}}
39 [c depunavailInA]; // expected-warning {{'depunavailInA' may be unavailable because the receiver type is unknown}}
40 [c depunavailInA1];// expected-warning {{'depunavailInA1' may be unavailable because the receiver type is unknown}}
41 [c FuzzyMeth]; // expected-warning {{'FuzzyMeth' may be deprecated because the receiver type is unknown}}
42 [c FuzzyMeth1]; // expected-warning {{'FuzzyMeth1' may be deprecated because the receiver type is unknown}}
Fariborz Jahanian8e5fc9b2010-12-21 00:44:01 +000043
44}
45
Fariborz Jahanian43bcdb22011-10-15 19:18:36 +000046// rdar://10268422
47__attribute ((deprecated))
Stephen Hines651f13c2014-04-23 16:59:28 -070048@interface DEPRECATED // expected-note {{'DEPRECATED' has been explicitly marked deprecated here}}
Fariborz Jahanian43bcdb22011-10-15 19:18:36 +000049+(id)new;
50@end
51
52void foo() {
Richard Trieu2fe9b7f2011-12-15 00:38:15 +000053 [DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}}
Fariborz Jahanian43bcdb22011-10-15 19:18:36 +000054}
55