blob: 5ed3dcbcd18adc21c2a1090cdef2bdce4d24cb25 [file] [log] [blame]
// { dg-additional-options "-w" }
struct S1 {
virtual ~S1();
virtual void v();
};
struct S2: S1 {};
struct S3: S1, S2 { void v(); };
struct S4: S3 { void v(); };
void S4::v() { S3::v(); }
struct R {
S1 * m;
void f(S2 * x) {
static_cast<S1 *>(x)->v();
x->v();
m = x;
}
};
void f() {
R r;
r.f(new S4);
r.f(new S3);
}