xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/g++.old-deja/g++.jason/dcast1.C (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 // PRMS Id: 7162
2 // Build don't link:
3 
4 struct B {
5    int i;
BB6    B() : i(1) {}
7 };
8 
9 struct D : B {
10    int i;
DD11    D() : i(2) {}
12 };
13 
ch()14 void ch()
15 {
16    D od2;
17    D &rd2 = od2;
18 
19    B &rd1 = dynamic_cast<B&>(rd2);
20 }
21