brintos

brintos / llvm-project-archived public Read only

0
0
Text · 699 B · ecc3681 Raw
21 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify %s2// Test that a property can be synthesize in a category3// implementation with no error.4 5@protocol MyProtocol6@property float  myFloat;7@property float  anotherFloat; // expected-note 2 {{property declared}}8@end9 10@interface MyObject { float anotherFloat; }11@end12 13@interface MyObject (CAT) <MyProtocol>14@end15 16@implementation MyObject (CAT)	// expected-warning  {{property 'anotherFloat' requires method}} \17                                // expected-warning {{property 'anotherFloat' requires method 'setAnotherFloat:'}}18@dynamic myFloat;	// OK19@synthesize anotherFloat; // expected-error {{@synthesize not allowed in a category's implementation}}20@end21