OSDN Git Service

* g++.old-deja/g++.eh/cleanup2.C: New test.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.ext / bound1.C
1 // Testcase for cast of bound pointer to member function.
2 // Special g++ Options: -Wno-pmf-conversions
3 // Build don't link:
4
5 struct A {
6   int f ();
7 };
8
9 typedef int (*fptr)(A *);
10 typedef void* vptr;
11 typedef int (A::*pmf)();
12
13 int foo (A* ap, pmf fp, int A::* ip)
14 {
15   fptr p;
16   vptr q;
17   A a;
18
19   p = (fptr)(ap->*fp);
20   p = (fptr)(ap->*fp);
21   p = (fptr)(ap->*(&A::f));
22   p = (fptr)(a.*fp);
23   p = (fptr)(a.*(&A::f));
24
25   q = (vptr)(ap->*fp);
26   q = (vptr)(ap->*(&A::f));
27   q = (vptr)(a.*fp);
28   q = (vptr)(a.*(&A::f));
29 }