1 // RUN: %clang_cc1 -fsyntax-only -fobjc-runtime-has-weak -fobjc-weak -fblocks -Wno-objc-root-class -std=c++98 -Wno-c++0x-extensions -verify %s
4 @property(weak) id value;
7 __attribute__((objc_arc_weak_reference_unavailable))
8 @interface NOWEAK : AnObject // expected-note 2 {{class is declared here}}
12 __weak id a; // expected-note {{because type 'S' has a member with __weak ownership}}
17 S b; // expected-error {{union member 'b' has a non-trivial copy constructor}}
20 void testCast(AnObject *o) {
21 __weak id a = reinterpret_cast<__weak NOWEAK *>(o); // expected-error {{class is incompatible with __weak references}} \
22 // expected-error {{explicit ownership qualifier on cast result has no effect}} \
23 // expected-error {{assignment of a weak-unavailable object to a __weak object}}
25 __weak id b = static_cast<__weak NOWEAK *>(o); // expected-error {{class is incompatible with __weak references}} \
26 // expected-error {{explicit ownership qualifier on cast result has no effect}} \
27 // expected-error {{assignment of a weak-unavailable object to a __weak object}}