blob: a4411fc468320a75b3926c534c75676fe1062a9f [file] [log] [blame]
Hans Wennborgc9bd88e2014-01-14 19:35:09 +00001// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o -
Hans Wennborgfbf3bb62014-02-12 21:40:46 +00002// RUN: %clang_cc1 -triple %ms_abi_triple -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}