Improve the diagnostic for -Wcustom-atomic-properties. Suggestion by Fariborz!
[clang.git] / test / SemaObjC / ivar-access-package.m
blobabc3420f1bd2c7b40398f39a3c52a383117a64bd
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 typedef unsigned char BOOL;
5 @interface NSObject {
6   id isa;
8 +new;
9 +alloc;
10 -init;
11 -autorelease;
12 @end
14 @interface NSAutoreleasePool : NSObject
15 - drain;
16 @end
18 @interface A : NSObject {
19 @package
20     id object;
22 @end
24 @interface B : NSObject
25 - (BOOL)containsSelf:(A*)a;
26 @end
28 @implementation A
29 @end
31 @implementation B
32 - (BOOL)containsSelf:(A*)a {
33     return a->object == self;
35 @end
37 void NSLog(id, ...);
39 int main (int argc, const char * argv[]) {
40     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
41     A *a = [[A new] autorelease];
42     B *b = [[B new] autorelease];
43     NSLog(@"%s", [b containsSelf:a] ? "YES" : "NO");
44     [pool drain];
45     return 0;