Zhongxing Xu | e17da65 | 2011-01-13 12:46:31 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store region -analyzer-inline-call -cfg-add-initializers -verify %s |
Zhongxing Xu | d074441 | 2011-01-13 12:30:12 +0000 | [diff] [blame] | 2 | |
3 | class A { | ||||
4 | int x; | ||||
5 | public: | ||||
6 | A(); | ||||
7 | int getx() const { | ||||
8 | return x; | ||||
9 | } | ||||
10 | }; | ||||
11 | |||||
12 | A::A() : x(0) { | ||||
13 | } | ||||
14 | |||||
15 | class B : public A { | ||||
16 | int y; | ||||
17 | public: | ||||
18 | B(); | ||||
19 | }; | ||||
20 | |||||
21 | B::B() { | ||||
22 | } | ||||
23 | |||||
24 | void f() { | ||||
25 | B b; | ||||
26 | if (b.getx() != 0) { | ||||
27 | int *p = 0; | ||||
28 | *p = 0; // no-warning | ||||
29 | } | ||||
30 | } |