summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/property/property-neg-7.mm
blob: 4c3d5d7d3663eb61b8a8439ef9de287aec0d82c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do compile } */

@interface NSArray 
{
  int count;
}
@property(readonly) int count;
@end

@implementation NSArray
@synthesize count;
@end

void foo (NSArray *ans[], id pid, id apid[], int i) {
    NSArray *test;
    test.count = 1; /* { dg-error "readonly property can not be set" } */
    ((NSArray *)pid).count = 1;  /* { dg-error "readonly property can not be set" } */
    ((NSArray *)apid[i]).count = 1; /* { dg-error "readonly property can not be set" } */
    ans[i].count = 3; /* { dg-error "readonly property can not be set" } */
}