new
authorJason Merrill <jason@gcc.gnu.org>
Mon, 4 Jan 1999 11:55:40 +0000 (06:55 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 4 Jan 1999 11:55:40 +0000 (06:55 -0500)
From-SVN: r24482

gcc/testsuite/g++.old-deja/g++.ext/bound1.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.ext/bound1.C b/gcc/testsuite/g++.old-deja/g++.ext/bound1.C
new file mode 100644 (file)
index 0000000..3b926a4
--- /dev/null
@@ -0,0 +1,29 @@
+// Testcase for cast of bound pointer to member function.
+// Special g++ Options: -Wno-pmf-conversions
+// Build don't link:
+
+struct A {
+  int f ();
+};
+
+typedef int (*fptr)(A *);
+typedef void* vptr;
+typedef int (A::*pmf)();
+
+int foo (A* ap, pmf fp, int A::* ip)
+{
+  fptr p;
+  vptr q;
+  A a;
+
+  p = (fptr)(ap->*fp);
+  p = (fptr)(ap->*fp);
+  p = (fptr)(ap->*(&A::f));
+  p = (fptr)(a.*fp);
+  p = (fptr)(a.*(&A::f));
+
+  q = (vptr)(ap->*fp);
+  q = (vptr)(ap->*(&A::f));
+  q = (vptr)(a.*fp);
+  q = (vptr)(a.*(&A::f));
+}