| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -Wobjc-property-assign-on-object-type %s |
| 2 |
|
| 3 |
@interface Foo @end |
| 4 |
@protocol Prot @end |
| 5 |
|
| 6 |
@interface Bar |
| 7 |
@property(assign, readonly) Foo* o1; // expected-warning {{'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'}} |
| 8 |
@property(unsafe_unretained, readonly) Foo* o2; |
| 9 |
|
| 10 |
@property(assign) Class classProperty; |
| 11 |
@property(assign) Class<Prot> classWithProtocolProperty; |
| 12 |
@property(assign) int s1; |
| 13 |
@property(assign) int* s2; |
| 14 |
@end |
| 15 |
|
| 16 |
@interface Bar () |
| 17 |
@property(readwrite) Foo* o1; |
| 18 |
@property(readwrite) Foo* o2; |
| 19 |
@end |