xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/property-noprotocol-warning.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc// expected-no-diagnostics
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@interface Object
6*f4a2713aSLionel Sambuc+ (id) new;
7*f4a2713aSLionel Sambuc@end
8*f4a2713aSLionel Sambuc
9*f4a2713aSLionel Sambuc@protocol GCObject
10*f4a2713aSLionel Sambuc@property int class;
11*f4a2713aSLionel Sambuc@end
12*f4a2713aSLionel Sambuc
13*f4a2713aSLionel Sambuc@protocol DerivedGCObject <GCObject>
14*f4a2713aSLionel Sambuc@property int Dclass;
15*f4a2713aSLionel Sambuc@end
16*f4a2713aSLionel Sambuc
17*f4a2713aSLionel Sambuc@interface GCObject  : Object <DerivedGCObject> {
18*f4a2713aSLionel Sambuc    int ifield;
19*f4a2713aSLionel Sambuc    int iOwnClass;
20*f4a2713aSLionel Sambuc    int iDclass;
21*f4a2713aSLionel Sambuc}
22*f4a2713aSLionel Sambuc@property int OwnClass;
23*f4a2713aSLionel Sambuc@end
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc@implementation GCObject : Object
26*f4a2713aSLionel Sambuc@synthesize class=ifield;
27*f4a2713aSLionel Sambuc@synthesize Dclass=iDclass;
28*f4a2713aSLionel Sambuc@synthesize OwnClass=iOwnClass;
29*f4a2713aSLionel Sambuc@end
30*f4a2713aSLionel Sambuc
31*f4a2713aSLionel Sambucint main(int argc, char **argv) {
32*f4a2713aSLionel Sambuc    GCObject *f = [GCObject new];
33*f4a2713aSLionel Sambuc    f.class = 5;
34*f4a2713aSLionel Sambuc    f.Dclass = 1;
35*f4a2713aSLionel Sambuc    f.OwnClass = 3;
36*f4a2713aSLionel Sambuc    return f.class + f.Dclass  + f.OwnClass - 9;
37*f4a2713aSLionel Sambuc}
38