1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
4 @interface NSObject @end
6 typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t;
8 typedef struct S {int ii; } * __attribute__((objc_independent_class))dispatch_queue_t_2; // expected-warning {{Objective-C object}}
10 typedef struct { // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}}
11 NSObject *__attribute__((objc_independent_class)) ns; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}}
12 } __attribute__((objc_independent_class)) T;
14 dispatch_queue_t dispatch_queue_create(void);
16 @interface DispatchQPointerCastIssue : NSObject {
17 NSObject *__attribute__((objc_independent_class)) Ivar; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}}
20 @property (copy) NSObject *__attribute__((objc_independent_class)) Prop; // expected-warning {{'objc_independent_class' attribute may be put on a typedef only; attribute is ignored}}
22 typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t_1;
26 @implementation DispatchQPointerCastIssue
27 + (dispatch_queue_t) newDispatchQueue {
28 return dispatch_queue_create();
32 NSObject *get_nsobject(void) {
33 typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t;