method-call.cpp revision 7b99d12b4ca67fccdf5090761ba257732e954e75
1// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-inline-call -analyzer-store region -verify %s
2struct A {
3  int x;
4  A(int a) { x = a; }
5  int getx() { return x; }
6};
7
8void f1() {
9  A x(3);
10  if (x.getx() == 3) {
11    int *p = 0;
12    *p = 3;  // expected-warning{{Dereference of null pointer}}
13  } else {
14    int *p = 0;
15    *p = 3;  // no-warning
16  }
17}
18
19