| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
| 2 |
|
| 3 |
@interface NSObject @end |
| 4 |
|
| 5 |
typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t; |
| 6 |
|
| 7 |
typedef struct S {int ii; } * __attribute__((objc_independent_class))dispatch_queue_t_2; // expected-warning {{Objective-C object}} |
| 8 |
|
| 9 |
typedef struct { // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}} |
| 10 |
NSObject *__attribute__((objc_independent_class)) ns; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}} |
| 11 |
} __attribute__((objc_independent_class)) T; |
| 12 |
|
| 13 |
dispatch_queue_t dispatch_queue_create(void); |
| 14 |
|
| 15 |
@interface DispatchQPointerCastIssue : NSObject { |
| 16 |
NSObject *__attribute__((objc_independent_class)) Ivar; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}} |
| 17 |
} |
| 18 |
|
| 19 |
@property (copy) NSObject *__attribute__((objc_independent_class)) Prop; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}} |
| 20 |
|
| 21 |
typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t_1; |
| 22 |
|
| 23 |
@end |
| 24 |
|
| 25 |
@implementation DispatchQPointerCastIssue |
| 26 |
+ (dispatch_queue_t) newDispatchQueue { |
| 27 |
return dispatch_queue_create(); |
| 28 |
} |
| 29 |
@end |
| 30 |
|
| 31 |
NSObject *get_nsobject(void) { |
| 32 |
typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t; |
| 33 |
dispatch_queue_t dt; |
| 34 |
return dt; |
| 35 |
} |