diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/SemaObjC/error-missing-getter.m | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/SemaObjC/error-missing-getter.m')
-rw-r--r-- | test/SemaObjC/error-missing-getter.m | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/test/SemaObjC/error-missing-getter.m b/test/SemaObjC/error-missing-getter.m index 3c91ab2..3dce858 100644 --- a/test/SemaObjC/error-missing-getter.m +++ b/test/SemaObjC/error-missing-getter.m @@ -9,11 +9,34 @@ @end int func (int arg, Subclass *x) { - if (x.setterOnly) { // expected-error {{expected getter method not found on object of type 'Subclass *'}} + if (x.setterOnly) { // expected-error {{no getter method for read from property}} 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 *'}} + func(x.setterOnly + 1, x); // expected-error {{no getter method for read from property}} + int i = x.setterOnly + 1; // expected-error {{no getter method for read from property}} + return x.setterOnly + 1; // expected-error {{no getter method for read from property}} } +// <rdar://problem/12765391> + +@interface TestClass ++ (void) setSetterOnly : (int) arg; +@end + +int func2 (int arg) { + if (TestClass.setterOnly) { // expected-error {{no getter method for read from property}} + TestClass.setterOnly = 1; + } + func(TestClass.setterOnly + 1, x); // expected-error {{no getter method for read from property}} + int i = TestClass.setterOnly + 1; // expected-error {{no getter method for read from property}} + return TestClass.setterOnly + 1; // expected-error {{no getter method for read from property}} +} + +@interface Sub : Subclass +- (int) func3; +@end +@implementation Sub +- (int) func3 { + return super.setterOnly; // expected-error {{no getter method for read from property}} +} +@end |