]> granicus.if.org Git - clang/commitdiff
And a test case for my last patch.
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 22 Nov 2008 18:40:47 +0000 (18:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 22 Nov 2008 18:40:47 +0000 (18:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59875 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaObjC/property-error-readonly-assign.m [new file with mode: 0644]

diff --git a/test/SemaObjC/property-error-readonly-assign.m b/test/SemaObjC/property-error-readonly-assign.m
new file mode 100644 (file)
index 0000000..0a49ee4
--- /dev/null
@@ -0,0 +1,13 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@interface A
+ -(int) x;
+@property (readonly) int x;
+@property int ok;
+@end
+
+void f0(A *a) {
+  a.x = 10;  // expected-error {{assigning to property with 'readonly' attribute not allowed}}
+  a.ok = 20;
+}
+