1 // RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fblocks -verify %s
4 #if __has_feature(objc_arc)
5 __attribute__((ns_returns_retained)) id (^invalidBlockRedecl)(void); // expected-note {{previous definition is here}}
6 id (^invalidBlockRedecl)(void); //expected-error {{redefinition of 'invalidBlockRedecl' with a different type: 'id (^__strong)(void)' vs 'id ((^__strong))(void) __attribute__((ns_returns_retained))'}}
8 __attribute__((ns_returns_retained)) id (^invalidBlockRedecl)(void);
9 id (^invalidBlockRedecl)(void);
12 typedef __attribute__((ns_returns_retained)) id (^blockType)(void);
14 typedef __attribute__((ns_returns_retained)) int (^invalidBlockType)(void); // expected-warning {{'ns_returns_retained' attribute only applies to functions that return an Objective-C object}}
16 __attribute__((ns_returns_retained)) int functionDecl(void); // expected-warning {{'ns_returns_retained' attribute only applies to functions that return an Objective-C object}}