Argyrios Kyrtzidis | c4d2c90 | 2011-02-28 19:49:42 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region %s |
Zhongxing Xu | 4fd5681 | 2010-11-26 08:21:53 +0000 | [diff] [blame] | 2 | |
3 | class A { | ||||
4 | protected: | ||||
5 | int x; | ||||
6 | }; | ||||
7 | |||||
8 | class B : public A { | ||||
9 | public: | ||||
10 | void f(); | ||||
11 | }; | ||||
12 | |||||
13 | void B::f() { | ||||
14 | x = 3; | ||||
15 | } | ||||
Jordan Rose | 2c5f8d7 | 2012-08-09 21:24:02 +0000 | [diff] [blame^] | 16 | |
17 | |||||
18 | class C : public B { | ||||
19 | public: | ||||
20 | void g() { | ||||
21 | // This used to crash because we are upcasting through two bases. | ||||
22 | x = 5; | ||||
23 | } | ||||
24 | }; |