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