Home
last modified time | relevance | path

Searched refs:nil (Results 1 – 25 of 148) sorted by relevance

123456

/llvm-project-15.0.7/lldb/test/API/commands/expression/persist_objc_pointeetype/
H A Dmain.m35 assert(_sc_name == nil);
36 assert(_sc_name2 == nil);
37 assert(_sc_name3 == nil);
38 assert(_sc_name4 == nil);
39 assert(_sc_name5 == nil);
40 assert(_sc_name6 == nil);
41 assert(_sc_name7 == nil);
45 assert(_sc_name == nil);
46 assert(_sc_name2 == nil);
47 assert(_sc_name3 == nil);
[all …]
/llvm-project-15.0.7/clang/test/Analysis/inlining/
H A Dinline-defensive-checks.m47 // Test nil receiver suppression.
48 // We only suppress on nil receiver if the nil value is directly causing the bug.
74 // On a path where fPtr is nil, mem should be nil.
82 // On a path where fPtr is nzil, mem should be nil.
90 // On a path where fPtr is nzil, mem should be nil.
98 // On a path where fPtr is nil, mem should be nil.
99 // The warning is not suppressed because the receiver being nil is not
110 // On a path where fPtr is nil, mem should be nil.
111 // The warning is not suppressed because the receiver being nil is not
122 // On a path where fPtr is nil, mem should be nil.
[all …]
/llvm-project-15.0.7/clang/test/Analysis/
H A Dnullability-no-arc.mm3 #define nil 0 macro
21 TestObject *local = nil;
22 …return local; // expected-warning {{nil returned from a function that is expected to return a non-…
26 TestObject *local = nil;
32 …return nil; // expected-warning {{null returned from function that requires a non-null return valu…
33 …// expected-warning@-1 {{nil returned from a function that is expected to return a non-null value}}
37 return (TestObject * _Nonnull)nil; // no-warning
46 …TestObject * _Nonnull explicitlyZeroInitialized = nil; // expected-warning {{nil assigned to a poi…
66 ClassWithInitializers *other = nil;
76 return (ClassWithInitializers * _Nonnull)nil;
[all …]
H A DNSContainers.m5 #define nil ((id)0) macro
137 marray[1] = 0; // expected-warning {{Array element cannot be nil}}
165 d[key] = 0; // expected-warning {{'NSMutableDictionary' key cannot be nil}}
184 return @{@"abc":nilValue}; // expected-warning {{Dictionary value cannot be nil}}
199 return @[ @"a", myNil, @"c" ]; // expected-warning {{Array element cannot be nil}}
251 // key is nil because FooPtr is nil. However, FooPtr is set to nil inside an
303 // Don't warn about adding nil to a container when the receiver is also
304 // definitely nil.
311 // When view is nil, subviews is also nil so there should be no warning
318 return nil;
[all …]
H A Dnullability_nullonly.mm103 …TestObject * _Nonnull explicitlyZeroInitialized = nil; // expected-warning {{nil assigned to a poi…
110 TestObject *local = nil;
115 TestObject *local = nil;
120 …return nil; // expected-warning {{nil returned from a function that is expected to return a non-nu…
124 return (TestObject * _Nonnull)nil; // no-warning
132 SomeClass *local = nil;
137 SomeClass *local = nil;
142 SomeClass *local = nil;
153 s = nil;
157 // expected-warning@-2{{nil passed to a callee that requires a non-null 1st parameter}}
[all …]
H A Dvariadic-method-types.m12 #define nil (void*)0 macro
74 [NSArray arrayWithObjects:@"Hello", a, b, c, d, nil];
75 [NSArray arrayWithObjects:@"Foo", ^{}, nil];
77 …[NSArray arrayWithObjects:@"Foo", "Bar", "Baz", nil]; // expected-warning {{Argument to 'NSArray' …
79 …[NSSet setWithObjects:@"Foo", "Bar", nil]; // expected-warning {{Argument to 'NSSet' method 'setWi…
80 …[NSOrderedSet orderedSetWithObjects:@"Foo", "Bar", nil]; // expected-warning {{Argument to 'NSOrde…
82 …[[[NSArray alloc] initWithObjects:@"Foo", "Bar", nil] autorelease]; // expected-warning {{Argument…
84 [[[NSDictionary alloc] initWithObjectsAndKeys:@"Foo", (void*) 0, nil] autorelease]; // no-warning
85 …[[[NSDictionary alloc] initWithObjectsAndKeys:@"Foo", kCGImageSourceShouldCache, nil] autorelease]…
86 [[[NSDictionary alloc] initWithObjectsAndKeys:@"Foo", fooType, nil] autorelease]; // no-warning
[all …]
H A Dobjc-message.m15 // It is impossible for both o to be nil and result to be non-nil,
25 // We intentionally drop the nil flow (losing coverage) after a method
26 // call when the receiver may be nil in order to avoid inconsistencies of
35 // Both the receiver and the result should be nil after a message
36 // sent to a nil receiver returning a value of type id.
H A Dnil-receiver-undefined-larger-than-voidptr-ret.m86 // CHECK-darwin8: warning: The receiver of message 'longDoubleM' is nil and returns a value of type…
87 // CHECK-darwin8: warning: The receiver of message 'longlongM' is nil and returns a value of type '…
88 // CHECK-darwin8: warning: The receiver of message 'doubleM' is nil and returns a value of type 'do…
89 // CHECK-darwin8: warning: The receiver of message 'unsignedLongLongM' is nil and returns a value o…
90 // CHECK-darwin8: warning: The receiver of message 'longlongM' is nil and returns a value of type '…
92 // CHECK-darwin9-NOT: warning: The receiver of message 'longlongM' is nil and returns a value of ty…
93 // CHECK-darwin9-NOT: warning: The receiver of message 'unsignedLongLongM' is nil and returns a val…
94 // CHECK-darwin9-NOT: warning: The receiver of message 'doubleM' is nil and returns a value of type…
95 // CHECK-darwin9-NOT: warning: The receiver of message 'longlongM' is nil and returns a value of ty…
96 // CHECK-darwin9-NOT: warning: The receiver of message 'longDoubleM' is nil and returns a value of …
H A Dnullability-arc.mm11 #define nil ((id)0) macro
28 // expected-warning@-2{{nil passed to a callee that requires a non-null 1st parameter}}
29 // expected-note@-3 {{nil passed to a callee that requires a non-null 1st parameter}}
32 [self foo:nil];
35 // expected-note@-3{{Passing nil object reference via 1st parameter 'param'}}
H A Dtrustnonnullchecker_test.m75 // If the return value is non-nil, the index is non-nil.
98 if (nil != obj)
116 if (nil == obj)
134 if (nil == obj)
139 // The return value could still be nil for a non-nil index.
149 // The return value could still be nil for a non-nil index.
154 if (obj != nil) {
H A Dlocalization.m9 #define nil ((id)0) macro
11 [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
43 #define MCLocalizedString(s) NSLocalizedString(s,nil);
130 return nil;
170 return KHLocalizedString(@"OK",nil); // no-warning
172 …return KHLocalizedString(@"value.plural",nil); // expected-warning {{Plural cases are not supporte…
174 return nil;
185 // return KHLocalizedString(@"1",nil); // false-positive
187 // return KHLocalizedString(@"2",nil); // false-positive
189 // return KHLocalizedString(@"3",nil); // no-false-positive
[all …]
H A Dobjc-for.m6 #define nil ((id)0) macro
59 clang_analyzer_eval(x != nil); // expected-warning{{TRUE}}
62 clang_analyzer_eval(x != nil); // expected-warning{{TRUE}}
65 clang_analyzer_eval(x != nil); // expected-warning{{TRUE}}
68 clang_analyzer_eval(x != nil); // expected-warning{{TRUE}}
76 clang_analyzer_eval(x != nil); // expected-warning{{TRUE}}
82 clang_analyzer_eval(a != nil); // expected-warning{{UNKNOWN}}
84 clang_analyzer_eval(a != nil); // expected-warning{{TRUE}}
86 if (b != nil)
90 clang_analyzer_eval(b != nil); // expected-warning{{FALSE}}
[all …]
H A Dlocalization-aggressive.m12 #define nil ((id)0) macro
14 [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
115 …[bar drawAtPoint:CGPointMake(0, 0) withAttributes:nil]; // expected-warning {{User-facing text sho…
167 // A nil string should not raise an error
170 [testLabel setText:nil]; // no-warning
242 #define YOLOC(x) NSLocalizedString(x, nil)
245 …NSString *string = NSLocalizedString(@"LocalizedString", nil); // expected-warning {{Localized str…
246 …NSString *string2 = NSLocalizedString(@"LocalizedString", nil); // expected-warning {{Localized st…
259 …ng3 = NSLocalizedStringWithDefaultValue(@"LocalizedString", nil, [[NSBundle alloc] init], nil,@"")…
277 NSString *string2 = KCLocalizedString(@"Hello",nil); // no-warning
[all …]
/llvm-project-15.0.7/clang/test/SemaTemplate/
H A Dexample-typelist.cpp5 struct nil { }; struct
7 template<typename Head, typename Tail = nil>
33 struct length<nil> {
66 class reverse<nil> {
68 typedef nil type;
91 struct find<nil, T> {
92 typedef nil type;
98 int find1[is_same<find<unsigned_inttypes, int>::type, nil>::value? 1 : -1];
/llvm-project-15.0.7/clang/test/Rewriter/
H A Dweak_byref_objects.m3 #define nil 0 macro
5 __weak __block id foo = nil;
6 __block id foo2 = nil;
7 id foo3 = nil;
10 foo = nil;
11 foo2 = nil;
H A Drewrite-weak-attr.m3 __weak __block id foo = nil;
4 __block id foo2 = nil;
5 id foo3 = nil;
8 foo = nil;
9 foo2 = nil;
/llvm-project-15.0.7/clang/test/SemaObjC/
H A Dcomptypes-5.m3 #define nil (void *)0; macro
23 id <MyProtocol> obj_id_p = nil;
24 MyClass *obj_c_cat_p = nil;
25 MyOtherClass *obj_c_super_p = nil;
26 MyOtherClass<MyProtocol> *obj_c_super_p_q = nil;
27 MyClass<MyProtocol> *obj_c_cat_p_q = nil;
H A Dcomptypes-2.m4 #define nil (void *)0; macro
16 id obj = nil;
17 id<MyProtocol> obj_p = nil;
18 MyClass *obj_c = nil;
/llvm-project-15.0.7/clang/test/Analysis/diagnostics/
H A Dno-store-func-path-notes.m73 a = nil; // expected-note{{nil object reference stored to 'a'}}
76 …expectNonNull(a); // expected-warning{{nil passed to a callee that requires a non-null 1st paramet…
77 … // expected-note@-1{{nil passed to a callee that requires a non-null 1st parameter}}
87 self->a = nil; // expected-note{{nil object reference stored to 'a'}}
90 …expectNonNull(a); // expected-warning{{nil passed to a callee that requires a non-null 1st paramet…
91 … // expected-note@-1{{nil passed to a callee that requires a non-null 1st parameter}}
101 paramA->a = nil; // expected-note{{nil object reference stored to 'a'}}
104 …expectNonNull(paramA->a); // expected-warning{{nil passed to a callee that requires a non-null 1st…
105 … // expected-note@-1{{nil passed to a callee that requires a non-null 1st parameter}}
H A Dmacros.m24 if (o == nil) // expected-note {{Assuming 'o' is equal to nil}}
26 … forKey:[o description]]; // expected-warning {{Key argument to 'setObject:forKey:' cannot be nil}}
27 … // expected-note@-1 {{'description' not called because the receiver is nil}}
28 … // expected-note@-2 {{Key argument to 'setObject:forKey:' cannot be nil}}
/llvm-project-15.0.7/clang/test/ARCMT/
H A Dobjcmt-subscripting-literals.m7 #define nil ((void*) 0) macro
105 arr = [NSArray arrayWithObjects:str, str, nil];
108 dict = [NSDictionary dictionaryWithObjectsAndKeys: @"value1", @"key1", @"value2", @"key2", nil];
109 dict = [NSDictionary dictionaryWithObjectsAndKeys: PAIR(1), PAIR(2), nil];
117 nil ];
159 … arrayWithObjects:@"1", [NSArray array], nil] forKeys:[NSArray arrayWithObjects:@"A", [arr objectA…
169 NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: str, globStr, nil];
170 dict = [NSDictionary dictionaryWithObjectsAndKeys: globStr, str, nil];
174 NSArray *arr = [NSArray arrayWithObjects: globStr, globStr, nil];
175 arr = [NSArray arrayWithObjects: str, globStr, nil];
[all …]
H A Dremove-dealloc-method.m5 #define nil ((void*) 0) macro
22 [self setY:nil];
23 w = nil;
24 self.z = nil;
H A Dobjcmt-subscripting-literals-in-arc.m7 #define nil ((void*) 0) macro
99 arr = [NSArray arrayWithObjects:str, str, nil];
100 arr = [[NSArray alloc] initWithObjects:str, str, nil];
101 dict = [NSDictionary dictionaryWithObjectsAndKeys: @"value1", @"key1", @"value2", @"key2", nil];
102 dict = [[NSDictionary alloc] initWithObjectsAndKeys: @"value1", @"key1", @"value2", @"key2", nil];
104 …cts:[[NSArray alloc] initWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B"…
/llvm-project-15.0.7/clang/test/Index/
H A Dcomplete-macros.c4 #define nil 0 macro
13 int *ip = nil; in f2()
14 ip = nil; in f2()
15 g(nil); in f2()
/llvm-project-15.0.7/clang/test/SemaObjCXX/
H A Dcomptypes-7.mm3 #define nil nullptr macro
16 id obj = nil;
17 id <MyProtocol> obj_p = nil;
18 MyClass *obj_c = nil;
19 Class obj_C = nil;
22 int *j = nil;
68 Class bar1 = nil;
69 Class <MyProtocol> bar = nil;

123456