[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaObjC / property-atomic-redecl.m
blobcb6d73a4ac70cef6efd878a3fe8705440a68ab23
1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
3 @interface A
4 @end
6 // Readonly, atomic public redeclaration of property in subclass.
7 @interface AtomicInheritanceSuper
8 @property (readonly) A *property;
9 @end
11 @interface AtomicInheritanceSuper()
12 @property (nonatomic,readwrite,retain) A *property;
13 @end
15 @interface AtomicInheritanceSub : AtomicInheritanceSuper
16 @property (readonly) A *property;
17 @end
19 // Readonly, atomic public redeclaration of property in subclass.
20 @interface AtomicInheritanceSuper2
21 @property (readonly) A *property;
22 @end
24 @interface AtomicInheritanceSub2 : AtomicInheritanceSuper2
25 @property (nonatomic, readwrite, retain) A *property;
26 @end
28 @interface ReadonlyAtomic
29 @property (readonly, nonatomic) A *property;
30 @end
32 @interface ReadonlyAtomic ()
33 @property (readwrite) A *property;
34 @end
36 // Readonly, atomic public redeclaration of property in subclass.
37 @interface AtomicInheritanceSuper3
38 @property (readonly,atomic) A *property; // expected-note{{property declared here}}
39 @end
41 @interface AtomicInheritanceSuper3()
42 @property (nonatomic,readwrite,retain) A *property; // expected-warning{{'atomic' attribute on property 'property' does not match the property inherited from 'AtomicInheritanceSuper3'}}
43 @end
45 @interface AtomicInheritanceSub3 : AtomicInheritanceSuper3
46 @property (readonly) A *property;
47 @end
49 // Readonly, atomic public redeclaration of property in subclass.
50 @interface AtomicInheritanceSuper4
51 @property (readonly, atomic) A *property; // expected-note{{property declared here}}
52 @end
54 @interface AtomicInheritanceSub4 : AtomicInheritanceSuper4
55 @property (nonatomic, readwrite, retain) A *property; // expected-warning{{atomic' attribute on property 'property' does not match the property inherited from 'AtomicInheritanceSuper4'}}
56 @end