From: Fariborz Jahanian Date: Sat, 22 Nov 2008 18:40:47 +0000 (+0000) Subject: And a test case for my last patch. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7611f2812f4991caf02428a910c9b437d4dc0e8;p=clang And a test case for my last patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59875 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaObjC/property-error-readonly-assign.m b/test/SemaObjC/property-error-readonly-assign.m new file mode 100644 index 0000000000..0a49ee4809 --- /dev/null +++ b/test/SemaObjC/property-error-readonly-assign.m @@ -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; +} +