mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 04:59:09 +08:00
new
From-SVN: r24482
This commit is contained in:
parent
8d7f862cfb
commit
02275c91e6
29
gcc/testsuite/g++.old-deja/g++.ext/bound1.C
Normal file
29
gcc/testsuite/g++.old-deja/g++.ext/bound1.C
Normal file
@ -0,0 +1,29 @@
|
||||
// Testcase for cast of bound pointer to member function.
|
||||
// Special g++ Options: -Wno-pmf-conversions
|
||||
// Build don't link:
|
||||
|
||||
struct A {
|
||||
int f ();
|
||||
};
|
||||
|
||||
typedef int (*fptr)(A *);
|
||||
typedef void* vptr;
|
||||
typedef int (A::*pmf)();
|
||||
|
||||
int foo (A* ap, pmf fp, int A::* ip)
|
||||
{
|
||||
fptr p;
|
||||
vptr q;
|
||||
A a;
|
||||
|
||||
p = (fptr)(ap->*fp);
|
||||
p = (fptr)(ap->*fp);
|
||||
p = (fptr)(ap->*(&A::f));
|
||||
p = (fptr)(a.*fp);
|
||||
p = (fptr)(a.*(&A::f));
|
||||
|
||||
q = (vptr)(ap->*fp);
|
||||
q = (vptr)(ap->*(&A::f));
|
||||
q = (vptr)(a.*fp);
|
||||
q = (vptr)(a.*(&A::f));
|
||||
}
|
Loading…
Reference in New Issue
Block a user