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.
5 
6 struct A{
7   int i;
AA8   A () :i(1){}
9   virtual void foo();
10 }a;
11 
foo()12 void A::foo()
13 {
14   i = 0;
15 }
16 
main()17 int main()
18 {
19   void (*f)(A*) = (void(*)(A*))(&A::foo);
20   f(&a);
21   return a.i;
22 }
23