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