blob: 2ffa52f8e864435629608add4e8cb87028599889 [file] [log] [blame]
// PR rtl-optimization/36185
// { dg-do run }
// { dg-options "-O2 -fgcse-sm" }
struct Base {
virtual ~Base() {}
virtual void f() = 0;
};
struct Derived : Base {
Derived();
virtual void f() {}
};
struct Foo {
Foo(Base&);
};
Derived::Derived() {
Foo foo(*this);
}
Foo::Foo(Base& base) {
base.f();
}
int main() {
Derived d;
}