xref: /aosp_15_r20/external/clang/test/SemaObjC/unimplemented-protocol-prop.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class -disable-objc-default-synthesize-properties %s
2*67e74705SXin Li
3*67e74705SXin Li@protocol PROTOCOL0
4*67e74705SXin Li@required
5*67e74705SXin Li@property float MyProperty0; // expected-note 2 {{property declared}}
6*67e74705SXin Li@end
7*67e74705SXin Li
8*67e74705SXin Li@protocol PROTOCOL<PROTOCOL0>
9*67e74705SXin Li@required
10*67e74705SXin Li@property float MyProperty; // expected-note 2 {{property declared}}
11*67e74705SXin Li@optional
12*67e74705SXin Li@property float OptMyProperty;
13*67e74705SXin Li@end
14*67e74705SXin Li
15*67e74705SXin Li@interface I <PROTOCOL>
16*67e74705SXin Li@end
17*67e74705SXin Li
18*67e74705SXin Li@implementation I @end // expected-warning {{property 'MyProperty0' requires method 'MyProperty0' to be defined}} \
19*67e74705SXin Li                       // expected-warning {{property 'MyProperty0' requires method 'setMyProperty0:' to be defined}}\
20*67e74705SXin Li                       // expected-warning {{property 'MyProperty' requires method 'MyProperty' to be defined}} \
21*67e74705SXin Li                       // expected-warning {{property 'MyProperty' requires method 'setMyProperty:' to be defined}}
22*67e74705SXin Li
23*67e74705SXin Li// rdar://10120691
24*67e74705SXin Li// property is implemented in super class. No warning
25*67e74705SXin Li
26*67e74705SXin Li@protocol PROTOCOL1
27*67e74705SXin Li@property int MyProp;
28*67e74705SXin Li@end
29*67e74705SXin Li
30*67e74705SXin Li@interface superclass
31*67e74705SXin Li@property int MyProp;
32*67e74705SXin Li@end
33*67e74705SXin Li
34*67e74705SXin Li@interface childclass : superclass <PROTOCOL1>
35*67e74705SXin Li@end
36*67e74705SXin Li
37*67e74705SXin Li@implementation childclass
38*67e74705SXin Li@end
39*67e74705SXin Li
40