summaryrefslogtreecommitdiff
path: root/test/Analysis/reference.mm
blob: 1d73ccd6ead31d2b61d4aa5bd7f82a0fe2ef7fa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clang_analyze_cc1 -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}}
}