URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.martin/] [pmf2.C] - Rev 699
Compare with Previous | Blame | View Log
// { dg-do run }
// { dg-options "-Wno-pmf-conversions" }
// Test conversion of pointers to virtual member functions to
// pointers to non-member functions.
struct A{
int i;
A () :i(1){}
virtual void foo();
}a;
void A::foo()
{
i = 0;
}
int main()
{
void (*f)(A*) = (void(*)(A*))(&A::foo);
f(&a);
return a.i;
}