1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
3 @interface NSObject @end
5 typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t;
7 typedef struct S {int ii; } * __attribute__((objc_independent_class))dispatch_queue_t_2; // expected-warning {{Objective-C object}}
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;
13 dispatch_queue_t dispatch_queue_create(void);
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}}
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}}
21 typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t_1;
25 @implementation DispatchQPointerCastIssue
26 + (dispatch_queue_t) newDispatchQueue {
27 return dispatch_queue_create();
31 NSObject *get_nsobject(void) {
32 typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t;