summaryrefslogtreecommitdiff
path: root/clang/test/SemaObjC/error-missing-getter.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaObjC/error-missing-getter.m')
-rw-r--r--clang/test/SemaObjC/error-missing-getter.m19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/error-missing-getter.m b/clang/test/SemaObjC/error-missing-getter.m
new file mode 100644
index 0000000..3c91ab2
--- /dev/null
+++ b/clang/test/SemaObjC/error-missing-getter.m
@@ -0,0 +1,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 *'}}
+}
+