blob: 338da893aad80d0ce8dd6482a5775c85d783af80 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */
/* LLVM LOCAL test not applicable */
/* { dg-require-fdump "" } */
template <class T>
struct Bar
{
int get() { return static_cast<T*>(this)->get2(); }
};
struct Foo : public Bar<Foo>
{
int get2() { return x; }
int x;
};
int foo(Foo& f)
{
return f.get();
}
/* { dg-final { scan-tree-dump "return f->x;" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */