YouCompleteMe/cpp/llvm/tools/clang/test/SemaObjC/error-missing-getter.m
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

20 lines
682 B
Objective-C

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