view gcc/testsuite/g++.dg/torture/pr94202.C @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// { 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);
}