Lines Matching refs:_Nonnull
11 typedef int * _Nonnull nonnull_int_ptr; // expected-note{{'_Nonnull' specified here}}
16 typedef int * _Nonnull _Nonnull redundant_1; // expected-warning{{duplicate nullability specifier '_Nonnull'}}
19 typedef int * _Nonnull _Nullable conflicting_1; // expected-error{{nullability specifier '_Nonnull' conflicts with existing specifier '_Nullable'}}
20 typedef int * _Null_unspecified _Nonnull conflicting_2; // expected-error{{nullability specifier '_Null_unspecified' conflicts with existing specifier '_Nonnull'}}
23 typedef nonnull_int_ptr _Nonnull redundant_okay_1;
26 typedef nonnull_int_ptr _Nullable conflicting_2; // expected-error{{nullability specifier '_Nullable' conflicts with existing specifier '_Nonnull'}}
28 typedef nonnull_int_ptr_typedef _Nullable conflicting_2; // expected-error{{nullability specifier '_Nullable' conflicts with existing specifier '_Nonnull'}}
30 typedef nonnull_int_ptr_typedef_typedef _Null_unspecified conflicting_3; // expected-error{{nullability specifier '_Null_unspecified' conflicts with existing specifier '_Nonnull'}}
33 typedef int (* _Nonnull function_pointer_type_1)(int, int);
34 typedef int (^ _Nonnull block_type_1)(int, int);
37 typedef int _Nonnull int_type_1; // expected-error{{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int'}}
41 typedef _Nonnull int * nonnull_int_ptr_2;
43 typedef _Nonnull int (* function_pointer_type_2)(int, int);
44 typedef _Nonnull int (^ block_type_2)(int, int);
45 typedef _Nonnull int * * _Nullable nonnull_int_ptr_ptr_1;
46 typedef _Nonnull int *(^ block_type_3)(int, int);
47 typedef _Nonnull int *(* function_pointer_type_3)(int, int);
48 typedef _Nonnull int_ptr (^ block_type_4)(int, int);
49 typedef _Nonnull int_ptr (* function_pointer_type_4)(int, int);
50 typedef void (* function_pointer_type_5)(int_ptr _Nonnull);
52 void acceptFunctionPtr(_Nonnull int *(*)(void));
53 void acceptBlockPtr(_Nonnull int *(^)(void));
57 fp = (function_pointer_type_3)0; // expected-warning{{from 'function_pointer_type_3' (aka 'int * _Nonnull (*)(int, int)')}}
58 fp = (block_type_3)0; // expected-error{{from incompatible type 'block_type_3' (aka 'int * _Nonnull (^)(int, int)')}}
59 fp = (function_pointer_type_4)0; // expected-warning{{from 'function_pointer_type_4' (aka 'int * _Nonnull (*)(int, int)')}}
60 fp = (function_pointer_type_5)0; // expected-warning{{from 'function_pointer_type_5' (aka 'void (*)(int * _Nonnull)')}}
61 fp = (block_type_4)0; // expected-error{{from incompatible type 'block_type_4' (aka 'int_ptr _Nonnull (^)(int, int)')}}
68 typedef _Nonnull int * _Nullable * conflict_int_ptr_ptr_2; // expected-error{{nullability specifier '_Nonnull' cannot be applied to non-pointer type 'int'}}
71 typedef int * _Nonnull ambiguous_int_ptr;
77 int * _Nonnull ip_1 = &f; // expected-warning{{incompatible pointer types initializing 'int * _Nonnull' with an expression of type 'float *'}}
81 int * _Nonnull iptr;
82 float *fptr = iptr; // expected-warning{{incompatible pointer types initializing 'float *' with an expression of type 'int * _Nonnull'}}
84 int * * _Nonnull iptrptr;
85 float **fptrptr = iptrptr; // expected-warning{{incompatible pointer types initializing 'float **' with an expression of type 'int ** _Nonnull'}}
87 int * _Nullable * _Nonnull iptrptr2;
88 float * *fptrptr2 = iptrptr2; // expected-warning{{incompatible pointer types initializing 'float **' with an expression of type 'int * _Nullable * _Nonnull'}}
91 // Check passing null to a _Nonnull argument.
92 void accepts_nonnull_1(_Nonnull int *ptr);
93 void (*accepts_nonnull_2)(_Nonnull int *ptr);
94 void (^accepts_nonnull_3)(_Nonnull int *ptr);
102 // Check returning nil from a _Nonnull-returning function.
103 _Nonnull int *returns_int_ptr(int x) {
108 return (_Nonnull int *)0;
114 _Nonnull int *b = ptr; // expected-warning{{implicit conversion from nullable pointer 'int * _Nullable' to non-nullable pointer type 'int * _Nonnull'}}
115 b = ptr; // expected-warning{{implicit conversion from nullable pointer 'int * _Nullable' to non-nullable pointer type 'int * _Nonnull'}}
117 accepts_nonnull_1(ptr); // expected-warning{{implicit conversion from nullable pointer 'int * _Nullable' to non-nullable pointer type 'int * _Nonnull'}}