]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaObjC/property-category-2.m
Update clang to r94309.
[FreeBSD/FreeBSD.git] / test / SemaObjC / property-category-2.m
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // Test that a property can be synthesize in a category
3 // implementation with no error.
4
5 @protocol MyProtocol
6 @property float  myFloat;
7 @property float  anotherFloat; // expected-warning {{property 'anotherFloat' requires method 'anotherFloat' to be defined - use @dynamic}} \
8                                // expected-warning {{property 'anotherFloat' requires method 'setAnotherFloat:' to be defined }}
9 @end
10
11 @interface MyObject { float anotherFloat; }
12 @end
13
14 @interface MyObject (CAT) <MyProtocol>
15 @end
16
17 @implementation MyObject (CAT)  // expected-note 2 {{implementation is here}}
18 @dynamic myFloat;       // OK
19 @synthesize anotherFloat; // expected-error {{@synthesize not allowed in a category's implementation}}
20 @end