2013-10-29 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / obj-c++.dg / property / property-neg-7.mm
blob4c3d5d7d3663eb61b8a8439ef9de287aec0d82c6
1 /* { dg-do compile } */
3 @interface NSArray 
5   int count;
7 @property(readonly) int count;
8 @end
10 @implementation NSArray
11 @synthesize count;
12 @end
14 void foo (NSArray *ans[], id pid, id apid[], int i) {
15     NSArray *test;
16     test.count = 1; /* { dg-error "readonly property can not be set" } */
17     ((NSArray *)pid).count = 1;  /* { dg-error "readonly property can not be set" } */
18     ((NSArray *)apid[i]).count = 1; /* { dg-error "readonly property can not be set" } */
19     ans[i].count = 3; /* { dg-error "readonly property can not be set" } */