blob: ecc368162bfaad8d86bbb5a9ca9f32f852f2e978 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanianf034e9c2009-01-19 18:16:19 +00002// Test that a property can be synthesize in a category
3// implementation with no error.
4
5@protocol MyProtocol
6@property float myFloat;
Fariborz Jahanianb8607392011-08-27 21:55:47 +00007@property float anotherFloat; // expected-note 2 {{property declared}}
Fariborz Jahanianf034e9c2009-01-19 18:16:19 +00008@end
9
10@interface MyObject { float anotherFloat; }
11@end
12
13@interface MyObject (CAT) <MyProtocol>
14@end
15
Fariborz Jahanianb8607392011-08-27 21:55:47 +000016@implementation MyObject (CAT) // expected-warning {{property 'anotherFloat' requires method}} \
17 // expected-warning {{property 'anotherFloat' requires method 'setAnotherFloat:'}}
Fariborz Jahanianf034e9c2009-01-19 18:16:19 +000018@dynamic myFloat; // OK
19@synthesize anotherFloat; // expected-error {{@synthesize not allowed in a category's implementation}}
20@end