You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
375 B
18 lines
375 B
// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-null-dereference %s
|
|
|
|
@interface Foo
|
|
- (int &)ref;
|
|
@end
|
|
|
|
Foo *getFoo() { return 0; }
|
|
|
|
void testNullPointerSuppression() {
|
|
getFoo().ref = 1;
|
|
}
|
|
|
|
void testPositiveNullReference() {
|
|
Foo *x = 0;
|
|
x.ref = 1; // expected-warning {{The receiver of message 'ref' is nil, which results in forming a null reference}}
|
|
}
|
|
|