blob: b2bb292130b1a9fa238dfd610e6e70b4cbd057c8 [file] [log] [blame]
Hans Wennborg442e4f72013-12-13 22:43:52 +00001// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o -
2// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm %s -o -
Eric Christopher6672b332011-08-20 00:09:39 +00003
4struct A {
5 virtual void Method() = 0;
6};
7
8struct B : public A {
9 virtual void Method() { }
10};
11
12typedef void (A::*fn_type_a)(void);
13typedef void (B::*fn_type_b)(void);
14
15int main(int argc, char **argv)
16{
17 fn_type_a f = reinterpret_cast<fn_type_a>(&B::Method);
18 fn_type_b g = reinterpret_cast<fn_type_b>(f);
19 B b;
20 (b.*g)();
21 return 0;
22}