Clang Project

clang_source_code/test/SemaObjCXX/Inputs/nullability-consistency-2.h
1void g1(int * _Nonnull);
2
3void g2(int (^block)(int, int)); // expected-warning{{block pointer is missing a nullability type specifier}}
4// expected-note@-1 {{insert '_Nullable' if the block pointer may be null}}
5// expected-note@-2 {{insert '_Nonnull' if the block pointer should never be null}}
6
7void g3(const
8        id // expected-warning{{missing a nullability type specifier}}
9        volatile
10// expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
11// expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
12        * // expected-warning{{missing a nullability type specifier}}
13// expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
14// expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
15        ); 
16
17@interface SomeClass
18@property (retain,nonnull) id property1;
19@property (retain,nullable) SomeClass *property2;
20- (nullable SomeClass *)method1;
21- (void)method2:(nonnull SomeClass *)param;
22@property (readonly, weak) SomeClass *property3; // expected-warning{{missing a nullability type specifier}}
23// expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
24// expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
25@end
26
27@interface SomeClass ()
28@property (readonly, weak) SomeClass *property4; // expected-warning{{missing a nullability type specifier}}
29// expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
30// expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
31@end
32