[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / SemaObjC / attr-ns_returns_retained.m
blob37e1416d5e8dad03643d298be886667c01811476
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))'}}
7 #else
8 __attribute__((ns_returns_retained)) id (^invalidBlockRedecl)(void);
9 id (^invalidBlockRedecl)(void);
10 #endif
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}}