New test case.
From-SVN: r29561
This commit is contained in:
parent
118a6ea134
commit
54965141fb
21
gcc/testsuite/g++.old-deja/g++.martin/pmf2.C
Normal file
21
gcc/testsuite/g++.old-deja/g++.martin/pmf2.C
Normal file
@ -0,0 +1,21 @@
|
||||
// Special g++ Options: -Wno-pmf-conversions
|
||||
// Test conversion of pointers to virtual member functions to
|
||||
// pointers to non-member functions.
|
||||
|
||||
struct A{
|
||||
int i;
|
||||
A::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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user