aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/derived-to-base.cpp
blob: f6c9beb46576cac1a77be938cfba3fd6f7ad111d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store region %s

class A {
protected:
  int x;
};

class B : public A {
public:
  void f();
};

void B::f() {
  x = 3;
}


class C : public B {
public:
  void g() {
    // This used to crash because we are upcasting through two bases.
    x = 5;
  }
};