llvm-project/clang/test/SemaObjC/error-missing-getter.m

20 lines
682 B
Mathematica
Raw Normal View History

// 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 *'}}
}