blob: 35880ab36302a4159305201b9c3fe1d196b81fd4 [file] [log] [blame]
Dan Gohmanfea1dd02009-08-25 15:38:29 +00001// RUN: %llvmgxx -S %s -o - | llvm-as -o /dev/null
Tanya Lattnerd13e0ae2004-11-06 22:29:57 +00002
Chris Lattner313b84b2004-03-09 00:55:58 +00003struct A {
4 virtual void Method() = 0;
5};
6
7struct B : public A {
8 virtual void Method() { }
9};
10
11typedef void (A::*fn_type_a)(void);
12typedef void (B::*fn_type_b)(void);
13
14int main(int argc, char **argv)
15{
16 fn_type_a f = reinterpret_cast<fn_type_a>(&B::Method);
17 fn_type_b g = reinterpret_cast<fn_type_b>(f);
18 B b;
19 (b.*g)();
20 return 0;
21}