8sa1-gcc/gcc/testsuite/g++.old-deja/g++.mike/pmf8.C
Jeff Law 921e5a0eb4 Initial revision
From-SVN: r14840
1997-08-19 01:34:40 -06:00

32 lines
411 B
C

int fail;
class A *ptr_a;
class A {
public:
char space1[24];
virtual void foo() {
if (this != ptr_a)
fail = 1;
}
};
class Space {
char space2[36];
};
class B : public Space, public A {
} b;
void (B::*pmf1)() = &A::foo;
void (A::*pmf2)() = &A::foo;
int main() {
ptr_a = &b;
(b .* (void (B::*) ()) &A::foo) ();
(b .* pmf1) ();
(b .* pmf2) ();
(b .* &A::foo) ();
return fail;
}