blob: faf0984eeb4b7d538c6d84514265d69cec0dd6f0 [file] [log] [blame]
/* PR middle-end/88232 - Please implement -Winfinite-recursion
{ dg-do compile }
{ dg-options "-Wall -Winfinite-recursion" } */
template <typename D>
struct C
{
void foo () // { dg-warning "-Winfinite-recursion" }
{
static_cast<D *>(this)->foo ();
}
};
struct D : C<D>
{
// this is missing:
// void foo() {}
};
void f (D *d)
{
d->foo ();
}
struct E : C<D>
{
void foo() {}
};
void g (E *e)
{
e->foo ();
}