36 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s2 3@interface NSObject @end4 5typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t;6 7typedef struct S {int ii; } * __attribute__((objc_independent_class))dispatch_queue_t_2; // expected-warning {{Objective-C object}}8 9typedef 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 13dispatch_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 21typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t_1;22 23@end24 25@implementation DispatchQPointerCastIssue26+ (dispatch_queue_t) newDispatchQueue {27 return dispatch_queue_create();28}29@end30 31NSObject *get_nsobject(void) {32 typedef NSObject * __attribute__((objc_independent_class))dispatch_queue_t;33 dispatch_queue_t dt;34 return dt;35}36