xref: /aosp_15_r20/external/clang/test/SemaObjC/duplicate-property-class-extension.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1  -fsyntax-only -verify %s
2*67e74705SXin Li// rdar://7629420
3*67e74705SXin Li
4*67e74705SXin Li@interface Foo
5*67e74705SXin Li@property (readonly) char foo;
6*67e74705SXin Li@property (readwrite) char bar; // expected-note {{property declared here}}
7*67e74705SXin Li@end
8*67e74705SXin Li
9*67e74705SXin Li@interface Foo ()
10*67e74705SXin Li@property (readwrite) char foo; // expected-note 2 {{property declared here}}
11*67e74705SXin Li@property (readwrite) char NewProperty; // expected-note 2 {{property declared here}}
12*67e74705SXin Li@property (readwrite) char bar; // expected-error{{illegal redeclaration of 'readwrite' property in class extension 'Foo' (perhaps you intended this to be a 'readwrite' redeclaration of a 'readonly' public property?)}}
13*67e74705SXin Li@end
14*67e74705SXin Li
15*67e74705SXin Li@interface Foo ()
16*67e74705SXin Li@property (readwrite) char foo;	 // expected-error {{property has a previous declaration}}
17*67e74705SXin Li@property (readwrite) char NewProperty; // expected-error {{property has a previous declaration}}
18*67e74705SXin Li@end
19*67e74705SXin Li
20*67e74705SXin Li@interface Foo ()
21*67e74705SXin Li@property (readonly) char foo; // expected-error {{property has a previous declaration}}
22*67e74705SXin Li@property (readwrite) char NewProperty; // expected-error {{property has a previous declaration}}
23*67e74705SXin Li@end
24*67e74705SXin Li
25