xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/protocol-attribute.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s
2f4a2713aSLionel Sambuc
3f4a2713aSLionel Sambuc__attribute ((unavailable))
4f4a2713aSLionel Sambuc@protocol FwProto; // expected-note{{marked unavailable}}
5f4a2713aSLionel Sambuc
6f4a2713aSLionel SambucClass <FwProto> cFw = 0;  // expected-error {{'FwProto' is unavailable}}
7f4a2713aSLionel Sambuc
8f4a2713aSLionel Sambuc
9*0a6a1f1dSLionel Sambuc__attribute ((deprecated)) @protocol MyProto1 // expected-note 7 {{'MyProto1' has been explicitly marked deprecated here}}
10f4a2713aSLionel Sambuc@end
11f4a2713aSLionel Sambuc
12f4a2713aSLionel Sambuc@protocol Proto2  <MyProto1>  // expected-warning {{'MyProto1' is deprecated}}
13f4a2713aSLionel Sambuc+method2;
14f4a2713aSLionel Sambuc@end
15f4a2713aSLionel Sambuc
16f4a2713aSLionel Sambuc
17f4a2713aSLionel Sambuc@interface MyClass1 <MyProto1>  // expected-warning {{'MyProto1' is deprecated}}
18f4a2713aSLionel Sambuc{
19f4a2713aSLionel Sambuc  Class isa;
20f4a2713aSLionel Sambuc}
21f4a2713aSLionel Sambuc@end
22f4a2713aSLionel Sambuc
23f4a2713aSLionel Sambuc@interface Derived : MyClass1 <MyProto1>  // expected-warning {{'MyProto1' is deprecated}}
24f4a2713aSLionel Sambuc{
25f4a2713aSLionel Sambuc	id <MyProto1> ivar;  // expected-warning {{'MyProto1' is deprecated}}
26f4a2713aSLionel Sambuc}
27f4a2713aSLionel Sambuc@end
28f4a2713aSLionel Sambuc
29f4a2713aSLionel Sambuc@interface MyClass1 (Category) <MyProto1, Proto2>  // expected-warning {{'MyProto1' is deprecated}}
30f4a2713aSLionel Sambuc@end
31f4a2713aSLionel Sambuc
32f4a2713aSLionel Sambuc
33f4a2713aSLionel Sambuc
34f4a2713aSLionel SambucClass <MyProto1> clsP1 = 0;  // expected-warning {{'MyProto1' is deprecated}}
35f4a2713aSLionel Sambuc
36f4a2713aSLionel Sambuc@protocol FwProto @end // expected-note{{marked unavailable}}
37f4a2713aSLionel Sambuc
38f4a2713aSLionel Sambuc@interface MyClass2 <FwProto> // expected-error {{'FwProto' is unavailable}}
39f4a2713aSLionel Sambuc@end
40f4a2713aSLionel Sambuc
41f4a2713aSLionel Sambuc__attribute ((unavailable)) __attribute ((deprecated)) @protocol XProto; // expected-note{{marked unavailable}}
42f4a2713aSLionel Sambuc
43f4a2713aSLionel Sambucid <XProto> idX = 0; // expected-error {{'XProto' is unavailable}}
44f4a2713aSLionel Sambuc
45f4a2713aSLionel Sambucint main ()
46f4a2713aSLionel Sambuc{
47f4a2713aSLionel Sambuc	MyClass1 <MyProto1> *p1;  // expected-warning {{'MyProto1' is deprecated}}
48f4a2713aSLionel Sambuc}
49f4a2713aSLionel Sambuc
50