2 /* { dg-require-ifunc "" } */
3 /* { dg-options "-Wno-pmf-conversions" } */
11 int implementation ();
14 typedef int Func (Klass*);
16 static Func* resolver ();
19 int Klass::implementation (void)
21 printf ("'ere I am JH\n");
22 return a[0] + a[1] + a[2] + a[3];
25 Klass::Func* Klass::resolver ()
27 /* GCC guarantees this conversion to be safe and the resulting pointer
28 usable to call the member function using ordinary (i.e., non-member)
29 function call syntax. */
31 return reinterpret_cast<Func*>(&Klass::implementation);
34 int Klass::magic (void) __attribute__ ((ifunc ("_ZN5Klass8resolverEv")));
36 int Foo (Klass &obj, int (Klass::*pmf) ())
50 return Foo (obj, &Klass::magic) != 10;