@@ -24,7 +24,7 @@ void testBasicRules() {
24
24
25
25
Dummy *_Nonnull testNullReturn () {
26
26
Dummy *p = 0 ;
27
- return p; // expected-warning {{Null is returned from a function that is expected to return a non-null value}}
27
+ return p; // expected-warning {{Null returned from a function that is expected to return a non-null value}}
28
28
}
29
29
30
30
void onlyReportFirstPreconditionViolationOnPath () {
@@ -100,24 +100,24 @@ void testObjCARCImplicitZeroInitialization() {
100
100
}
101
101
102
102
void testObjCARCExplicitZeroInitialization () {
103
- TestObject * _Nonnull explicitlyZeroInitialized = nil ; // expected-warning {{Null is assigned to a pointer which is expected to have non-null value}}
103
+ TestObject * _Nonnull explicitlyZeroInitialized = nil ; // expected-warning {{nil assigned to a pointer which is expected to have non-null value}}
104
104
}
105
105
106
106
// Under ARC, returned expressions of ObjC objects types are are implicitly
107
107
// cast to _Nonnull when the functions return type is _Nonnull, so make
108
108
// sure this doesn't implicit cast doesn't suppress a legitimate warning.
109
109
TestObject * _Nonnull returnsNilObjCInstanceIndirectly () {
110
- TestObject *local = 0 ;
111
- return local; // expected-warning {{Null is returned from a function that is expected to return a non-null value}}
110
+ TestObject *local = nil ;
111
+ return local; // expected-warning {{nil returned from a function that is expected to return a non-null value}}
112
112
}
113
113
114
114
TestObject * _Nonnull returnsNilObjCInstanceIndirectlyWithSupressingCast () {
115
- TestObject *local = 0 ;
115
+ TestObject *local = nil ;
116
116
return (TestObject * _Nonnull)local; // no-warning
117
117
}
118
118
119
119
TestObject * _Nonnull returnsNilObjCInstanceDirectly () {
120
- return nil ; // expected-warning {{Null is returned from a function that is expected to return a non-null value}}
120
+ return nil ; // expected-warning {{nil returned from a function that is expected to return a non-null value}}
121
121
}
122
122
123
123
TestObject * _Nonnull returnsNilObjCInstanceDirectlyWithSuppressingCast () {
@@ -130,7 +130,7 @@ @interface SomeClass : NSObject
130
130
@implementation SomeClass (MethodReturn)
131
131
- (SomeClass * _Nonnull)testReturnsNilInNonnull {
132
132
SomeClass *local = nil ;
133
- return local; // expected-warning {{Null is returned from a method that is expected to return a non-null value}}
133
+ return local; // expected-warning {{nil returned from a method that is expected to return a non-null value}}
134
134
}
135
135
136
136
- (SomeClass * _Nonnull)testReturnsCastSuppressedNilInNonnull {
@@ -154,7 +154,7 @@ void callFunctionInSystemHeader() {
154
154
155
155
NSSystemFunctionTakingNonnull (s);
156
156
#if !NOSYSTEMHEADERS
157
- // expected-warning@-2{{Null passed to a callee that requires a non-null 1st parameter}}
157
+ // expected-warning@-2{{nil passed to a callee that requires a non-null 1st parameter}}
158
158
#endif
159
159
}
160
160
@@ -165,6 +165,6 @@ void callMethodInSystemHeader() {
165
165
NSSystemClass *sc = [[NSSystemClass alloc ] init ];
166
166
[sc takesNonnull: s];
167
167
#if !NOSYSTEMHEADERS
168
- // expected-warning@-2{{Null passed to a callee that requires a non-null 1st parameter}}
168
+ // expected-warning@-2{{nil passed to a callee that requires a non-null 1st parameter}}
169
169
#endif
170
170
}
0 commit comments