URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.martin/] [pmf2.C] - Rev 316
Go to most recent revision | 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;
}
Go to most recent revision | Compare with Previous | Blame | View Log