summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/dcast1.C
blob: 9336cba116331740bc3ca75a3161bdbe8ef50384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do assemble  }
// PRMS Id: 7162

struct B {
   int i;
   B() : i(1) {}
};

struct D : B {
   int i;
   D() : i(2) {}
};

void ch()
{
   D od2;
   D &rd2 = od2;

   B &rd1 = dynamic_cast<B&>(rd2);
}