brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · b914862 Raw
61 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2// expected-no-diagnostics3 4/* This test is for categories which don't implement the accessors but some accessors are5   implemented in their base class implementation. In this case,no warning must be issued.6*/7 8@interface MyClass 9{10    int        _foo;11}12@property(readonly)    int        foo;13@end14 15@implementation MyClass16- (int) foo        { return _foo; }17@end18 19@interface MyClass (private)20@property(readwrite)    int        foo;21@end22 23@implementation MyClass (private)24- (void) setFoo:(int)foo    { _foo = foo; }25@end26 27@interface MyClass (public)28@property(readwrite)    int        foo;	29@end30 31@implementation MyClass (public)32@end 33 34// No warn of unimplemented property of protocols in category,35// when those properties will be implemented in category's primary36// class or one of its super classes.37@interface HBSuperclass38@property (nonatomic) char myProperty;39@property (nonatomic) char myProperty2;40@end41 42@interface HBClass : HBSuperclass43@end44 45@protocol HBProtocol46@property (nonatomic) char myProperty;47@property (nonatomic) char myProperty2;48@end49 50@interface HBSuperclass (HBSCategory)<HBProtocol>51@end52 53@implementation HBSuperclass (HBSCategory)54@end55 56@interface HBClass (HBCategory)<HBProtocol>57@end58 59@implementation HBClass (HBCategory)60@end61