• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 @class Item;
2 @class Container<ObjectType>;
3 @protocol Protocol;
4 
5 // rdar://problem/34260995
6 // The first pointer in the file is handled in a different way so need
7 // a separate test for this case even if the parameter type is the same as in
8 // objcIdParameterWithProtocol.
9 void objcIdParameterWithProtocolFirstInFile(id<Protocol> i); // expected-warning {{pointer is missing a nullability type specifier}}
10 // expected-note@-1 {{insert '_Nullable'}}
11 // expected-note@-2 {{insert '_Nonnull'}}
12 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-3]]:57-[[@LINE-3]]:57}:" _Nullable"
13 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-4]]:57-[[@LINE-4]]:57}:" _Nonnull"
14 
15 int * _Nonnull forceNullabilityWarningsObjC(void);
16 
17 void objcClassParameter(Item *i); // expected-warning {{pointer is missing a nullability type specifier}}
18 // expected-note@-1 {{insert '_Nullable'}}
19 // expected-note@-2 {{insert '_Nonnull'}}
20 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-3]]:31-[[@LINE-3]]:31}:" _Nullable "
21 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-4]]:31-[[@LINE-4]]:31}:" _Nonnull "
22 
23 void objcClassParameterWithProtocol(Item<Protocol> *i); // expected-warning {{pointer is missing a nullability type specifier}}
24 // expected-note@-1 {{insert '_Nullable'}}
25 // expected-note@-2 {{insert '_Nonnull'}}
26 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-3]]:53-[[@LINE-3]]:53}:" _Nullable "
27 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-4]]:53-[[@LINE-4]]:53}:" _Nonnull "
28 
29 // rdar://problem/34260995
30 void objcIdParameterWithProtocol(id<Protocol> i); // expected-warning {{pointer is missing a nullability type specifier}}
31 // expected-note@-1 {{insert '_Nullable'}}
32 // expected-note@-2 {{insert '_Nonnull'}}
33 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-3]]:46-[[@LINE-3]]:46}:" _Nullable"
34 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-4]]:46-[[@LINE-4]]:46}:" _Nonnull"
35 
36 // Class parameters don't have nullability type specifier.
37 void objcParameterizedClassParameter(Container<Item *> *c); // expected-warning {{pointer is missing a nullability type specifier}}
38 // expected-note@-1 {{insert '_Nullable'}}
39 // expected-note@-2 {{insert '_Nonnull'}}
40 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-3]]:57-[[@LINE-3]]:57}:" _Nullable "
41 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-4]]:57-[[@LINE-4]]:57}:" _Nonnull "
42 
43 // Class parameters don't have nullability type specifier.
44 void objcParameterizedClassParameterWithProtocol(Container<id<Protocol>> *c); // expected-warning {{pointer is missing a nullability type specifier}}
45 // expected-note@-1 {{insert '_Nullable'}}
46 // expected-note@-2 {{insert '_Nonnull'}}
47 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-3]]:75-[[@LINE-3]]:75}:" _Nullable "
48 // CHECK: fix-it:"{{.*}}nullability-objc.h":{[[@LINE-4]]:75-[[@LINE-4]]:75}:" _Nonnull "
49