brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 1f71315 Raw
34 lines · c
1typedef int* _Nonnull mynonnull;2 3__attribute__((objc_root_class))4@interface typedefClass5- (void) func1:(mynonnull)i;6@end7 8void func2(mynonnull i);9 10void func3(int *); // expected-warning{{pointer is missing a nullability type specifier}}11// expected-note@-1{{insert '_Nullable' if the pointer may be null}}12// expected-note@-2{{insert '_Nonnull' if the pointer should never be null}}13 14#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))15typedef void *CFTypeRef;16void cf1(CFTypeRef * p CF_RETURNS_NOT_RETAINED); // expected-warning{{pointer is missing a nullability type specifier}}17// expected-note@-1{{insert '_Nullable' if the pointer may be null}}18// expected-note@-2{{insert '_Nonnull' if the pointer should never be null}}19 20void cf2(CFTypeRef * _Nullable p CF_RETURNS_NOT_RETAINED);21void cf3(CFTypeRef * _Nonnull p CF_RETURNS_NOT_RETAINED);22 23void cf4(CFTypeRef _Nullable * _Nullable p CF_RETURNS_NOT_RETAINED);24void cf5(CFTypeRef _Nonnull * _Nullable p CF_RETURNS_NOT_RETAINED);25 26void cf6(CFTypeRef * _Nullable CF_RETURNS_NOT_RETAINED p);27void cf7(CF_RETURNS_NOT_RETAINED CFTypeRef * _Nonnull p);28 29typedef CFTypeRef _Nullable *CFTypeRefPtr;30void cfp1(CFTypeRefPtr p CF_RETURNS_NOT_RETAINED); // expected-warning{{pointer is missing a nullability type specifier}}31// expected-note@-1{{insert '_Nullable' if the pointer may be null}}32// expected-note@-2{{insert '_Nonnull' if the pointer should never be null}}33void cfp2(CFTypeRefPtr _Nonnull p CF_RETURNS_NOT_RETAINED);34