minix/external/bsd/llvm/dist/clang/test/Analysis/reference.mm
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

17 lines
375 B
Text

// 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}}
}