• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1 -analyze -analyzer-checker=core -verify -Wno-null-dereference %s
2
3@interface Foo
4- (int &)ref;
5@end
6
7Foo *getFoo() { return 0; }
8
9void testNullPointerSuppression() {
10	getFoo().ref = 1;
11}
12
13void testPositiveNullReference() {
14  Foo *x = 0;
15	x.ref = 1; // expected-warning {{The receiver of message 'ref' is nil, which results in forming a null reference}}
16}
17
18