8sa1-gcc/gcc/testsuite/g++.old-deja/g++.mike/p10849a.C

34 lines
403 B
C++
Raw Normal View History

1997-08-19 03:34:40 -04:00
// prms-id: 10849
struct A
{
int comm;
A(int i) : comm(i) { }
};
struct S1 { char c1; };
struct B : public S1, public A
{
B(int i) : A(i) { }
};
struct C : public A
{
C(int i) : A(i) { }
};
struct D : public B, public C
{
virtual int g() {
1998-03-16 18:56:43 -05:00
int D::*pmd = (int C::*)&C::comm;
1997-08-19 03:34:40 -04:00
return (this->*pmd) == 42;
}
D() : B(41), C(42) { }
} d;
1998-11-22 18:23:45 -05:00
int main() {
1997-08-19 03:34:40 -04:00
if (! d.g())
return 1;
}