1 // RUN: %clang_cc1 -fobjc-runtime=macosx-10.8 -fsyntax-only -verify %s
3 __attribute__((objc_root_class))
6 // These should not get diagnosed immediately.
10 @property __weak id y;
13 // Diagnostic goes on the ivar if it's explicit.
15 __weak id x; // expected-error {{cannot create __weak reference in file using manual reference counting}}
17 @property __weak id x;
23 // Otherwise, it goes with the @synthesize.
25 @property __weak id x; // expected-note {{property declared here}}
28 @synthesize x; // expected-error {{cannot synthesize weak property in file using manual reference counting}}
32 @property __weak id x; // expected-note {{property declared here}}
34 @implementation D // expected-error {{cannot synthesize weak property in file using manual reference counting}}
39 __weak id x; // expected-note 2 {{declaration uses __weak, but ARC is disabled}}
44 id x = e->x; // expected-error {{'x' is unavailable}}
45 e->x = x; // expected-error {{'x' is unavailable}}
49 @property (weak) id x;