2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / pmf8.C
blob10f67c6f00f0b862bf969149115adf4d3581a0b2
1 // { dg-do run  }
2 int fail;
4 class A *ptr_a;
6 class A {
7 public:
8   char space1[24];
9   virtual void foo() {
10     if (this != ptr_a)
11       fail = 1;
12   }
15 class Space {
16   char space2[36];
19 class B : public Space, public A {
20 } b;
22 void (B::*pmf1)() = &A::foo;
23 void (A::*pmf2)() = &A::foo;
25 int main() {
26   ptr_a = &b;
27   (b .* (void (B::*) ()) &A::foo) ();
28   (b .* pmf1) ();
29   (b .* pmf2) ();
30   (b .* &A::foo) ();
31   return fail;