annotate clang/test/SemaObjCXX/Inputs/nullability-consistency-2.h @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 void g1(int * _Nonnull);
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 void g2(int (^block)(int, int)); // expected-warning{{block pointer is missing a nullability type specifier}}
anatofuz
parents:
diff changeset
4 // expected-note@-1 {{insert '_Nullable' if the block pointer may be null}}
anatofuz
parents:
diff changeset
5 // expected-note@-2 {{insert '_Nonnull' if the block pointer should never be null}}
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 void g3(const
anatofuz
parents:
diff changeset
8 id // expected-warning{{missing a nullability type specifier}}
anatofuz
parents:
diff changeset
9 volatile
anatofuz
parents:
diff changeset
10 // expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
anatofuz
parents:
diff changeset
11 // expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
anatofuz
parents:
diff changeset
12 * // expected-warning{{missing a nullability type specifier}}
anatofuz
parents:
diff changeset
13 // expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
anatofuz
parents:
diff changeset
14 // expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
anatofuz
parents:
diff changeset
15 );
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 @interface SomeClass
anatofuz
parents:
diff changeset
18 @property (retain,nonnull) id property1;
anatofuz
parents:
diff changeset
19 @property (retain,nullable) SomeClass *property2;
anatofuz
parents:
diff changeset
20 - (nullable SomeClass *)method1;
anatofuz
parents:
diff changeset
21 - (void)method2:(nonnull SomeClass *)param;
anatofuz
parents:
diff changeset
22 @property (readonly, weak) SomeClass *property3; // expected-warning{{missing a nullability type specifier}}
anatofuz
parents:
diff changeset
23 // expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
anatofuz
parents:
diff changeset
24 // expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
anatofuz
parents:
diff changeset
25 @end
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 @interface SomeClass ()
anatofuz
parents:
diff changeset
28 @property (readonly, weak) SomeClass *property4; // expected-warning{{missing a nullability type specifier}}
anatofuz
parents:
diff changeset
29 // expected-note@-1 {{insert '_Nullable' if the pointer may be null}}
anatofuz
parents:
diff changeset
30 // expected-note@-2 {{insert '_Nonnull' if the pointer should never be null}}
anatofuz
parents:
diff changeset
31 @end