blob: e9071b1eb0f0a25083a9c2b1ac5e5e048c6b27e2 [file] [log] [blame]
Hans Wennborg442e4f72013-12-13 22:43:52 +00001// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o -
Hans Wennborgc5700612013-12-14 17:04:17 +00002
3// FIXME: Don't assert for non-Win32 triples (PR18251).
4// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -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}