From b7611f2812f4991caf02428a910c9b437d4dc0e8 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Sat, 22 Nov 2008 18:40:47 +0000 Subject: [PATCH] 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 --- test/SemaObjC/property-error-readonly-assign.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/SemaObjC/property-error-readonly-assign.m 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; +} + -- 2.40.0