Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/inherit.cxx

raw
1 struct point {
2 int x, y;
3 point(int x, int y): x(x), y(y) {}
4 };
5 struct A {
6 point foo, bar;
7 A(int i): foo(i, i + 1), bar(i + 2, i + 3) {}
8 };
9 struct B : A {
10 int foo;
11 B(): A(1), foo(42) {}
12 };
13
14 static B b;
15 int main() {
16 int sum = b.A::foo.x + b.A::foo.y + b.bar.x + b.bar.y + b.foo;
17 return sum != 10 + 42;
18 }