2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.martin / pmf2.C
blobe52ce9f61fa403accf3f2aa5c94a9d01dd1a51b2
1 // { dg-do run  }
2 // { dg-options "-Wno-pmf-conversions" }
3 // Test conversion of pointers to virtual member functions to
4 // pointers to non-member functions.
6 struct A{
7   int i;
8   A () :i(1){}
9   virtual void foo();
10 }a;
12 void A::foo()
14   i = 0;
17 int main()
19   void (*f)(A*) = (void(*)(A*))(&A::foo);
20   f(&a);
21   return a.i;