summaryrefslogtreecommitdiff
path: root/clang/test/SemaObjC/error-missing-getter.m
blob: 3c91ab2ffcd02de221430a15f4598429d4b589e2 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// RUN: %clang_cc1  -fsyntax-only -verify %s
// rdar://8155806

@interface Subclass 
{
    int setterOnly;
}
- (void) setSetterOnly : (int) arg;
@end

int func (int arg, Subclass *x) {
    if (x.setterOnly) { // expected-error {{expected getter method not found on object of type 'Subclass *'}}
      x.setterOnly = 1;
    }
    func(x.setterOnly + 1, x); // expected-error {{expected getter method not found on object of type 'Subclass *'}} 
    int i = x.setterOnly + 1;  // expected-error {{expected getter method not found on object of type 'Subclass *'}} 
    return x.setterOnly + 1;   // expected-error {{expected getter method not found on object of type 'Subclass *'}} 
}