]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaObjC/property-10.m
Update clang to r89205.
[FreeBSD/FreeBSD.git] / test / SemaObjC / property-10.m
1 // RUN: clang-cc -fsyntax-only -Wreadonly-setter-attrs -verify %s  -fblocks
2
3 // Check property attribute consistency.
4
5 @interface I0
6 @property(readonly, readwrite) int p0; // expected-error {{property attributes 'readonly' and 'readwrite' are mutually exclusive}}
7
8 @property(retain) int p1; // expected-error {{property with 'retain' attribute must be of object type}}
9
10 @property(copy) int p2; // expected-error {{property with 'copy' attribute must be of object type}}
11
12 @property(assign, copy) id p3_0; // expected-error {{property attributes 'assign' and 'copy' are mutually exclusive}} 
13 @property(assign, retain) id p3_1; // expected-error {{property attributes 'assign' and 'retain' are mutually exclusive}} 
14 @property(copy, retain) id p3_2; // expected-error {{property attributes 'copy' and 'retain' are mutually exclusive}} 
15 @property(assign, copy, retain) id p3_3; // expected-error {{property attributes 'assign' and 'copy' are mutually exclusive}}, expected-error {{property attributes 'assign' and 'retain' are mutually exclusive}} 
16
17 @property id p4; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}, expected-warning {{default property attribute 'assign' not appropriate for non-gc object}}
18
19 @property(nonatomic,copy) int (^includeMailboxCondition)(); 
20 @property(nonatomic,copy) int (*includeMailboxCondition2)(); // expected-error {{property with 'copy' attribute must be of object type}}
21
22 @end