blob: 81b8ee199cb296e8d02368058bb4b90ed7f54e43 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -Wreadonly-setter-attrs -verify %s -fblocks
Daniel Dunbar95e61fb2008-09-23 21:53:23 +00002
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}}
Steve Naroff2bd03722008-10-21 18:21:45 +000018
19@property(nonatomic,copy) int (^includeMailboxCondition)();
20@property(nonatomic,copy) int (*includeMailboxCondition2)(); // expected-error {{property with 'copy' attribute must be of object type}}
21
Daniel Dunbar95e61fb2008-09-23 21:53:23 +000022@end