blob: e7e34f1d710de32d10a0128abdc00b32a184e6e8 [file] [log] [blame]
Hans Wennborgc9bd88e2014-01-14 19:35:09 +00001// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o -
Hans Wennborgc5700612013-12-14 17:04:17 +00002
3// FIXME: Don't assert for non-Win32 triples (PR18251).
Hans Wennborgc9bd88e2014-01-14 19:35:09 +00004// RUN: %clang_cc1 -triple i686-pc-win32 -fno-rtti -emit-llvm %s -o -
Eric Christopher6672b332011-08-20 00:09:39 +00005
6struct A {
7 virtual void Method() = 0;
8};
9
10struct B : public A {
11 virtual void Method() { }
12};
13
14typedef void (A::*fn_type_a)(void);
15typedef void (B::*fn_type_b)(void);
16
17int main(int argc, char **argv)
18{
19 fn_type_a f = reinterpret_cast<fn_type_a>(&B::Method);
20 fn_type_b g = reinterpret_cast<fn_type_b>(f);
21 B b;
22 (b.*g)();
23 return 0;
24}