[llvm-commits] CVS: llvm/test/Regression/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 8 18:57:00 PST 2004


Changes in directory llvm/test/Regression/C++Frontend:

2004-03-08-ReinterpretCastCopy.cpp added (r1.1)

---
Log message:

Checkin testcase for PR261


---
Diffs of the changes:  (+19 -0)

Index: llvm/test/Regression/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp
diff -c /dev/null llvm/test/Regression/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp:1.1
*** /dev/null	Mon Mar  8 18:56:08 2004
--- llvm/test/Regression/C++Frontend/2004-03-08-ReinterpretCastCopy.cpp	Mon Mar  8 18:55:58 2004
***************
*** 0 ****
--- 1,19 ----
+ struct A {
+   virtual void Method() = 0;
+ };
+ 
+ struct B : public A {
+   virtual void Method() { }
+ };
+ 
+ typedef void (A::*fn_type_a)(void);
+ typedef void (B::*fn_type_b)(void);
+ 
+ int main(int argc, char **argv)
+ {
+   fn_type_a f = reinterpret_cast<fn_type_a>(&B::Method);
+   fn_type_b g = reinterpret_cast<fn_type_b>(f);
+   B b;
+   (b.*g)();
+   return 0;
+ }





More information about the llvm-commits mailing list