Rebase.
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / ref8.C
blob97dd51acf52cefd7b327e211e4c58c499610a306
1 // { dg-do run  }
2 // PRMS Id: 5184
3 // Bug: cast to C& below does not adjust address
5 struct A {};
6 struct B {
7   virtual void foo () {}
8 };
9 struct C : public B, public A {};
11 int main() {
12     C c;
14     A& ar = c;
15     C& cr = (C&)ar;
17     cr.foo();   // this line causes core dump