2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / ptrmem7.C
blob7d9e9b17d3d3b86276af51c4f22773576d77ecb2
1 // PR c++/70615
2 // { dg-options -O }
4 struct C
6   virtual void f () {}
7 };
9 struct B
11   virtual ~B () {}
14 class D : public B, public C
16 public:
17   D () {}
20 typedef void (C::*FP) ();
21 typedef void (D::*D_f) ();
23 int
24 main ()
26   D *d = new D ();
27   C *c = d;
28   const FP fptr = (FP) & D::f;
29   (d->*(D_f) fptr) ();
30   return 0;