// PR c++/27894
|
// PR c++/27894
|
// { dg-do compile }
|
// { dg-do compile }
|
// { dg-options "-O" }
|
// { dg-options "-O" }
|
|
|
class A;
|
class A;
|
struct B
|
struct B
|
{
|
{
|
B (unsigned long);
|
B (unsigned long);
|
int b2 () const;
|
int b2 () const;
|
A *b1 () const;
|
A *b1 () const;
|
};
|
};
|
|
|
enum { P = 0 };
|
enum { P = 0 };
|
enum O { Q = 75, };
|
enum O { Q = 75, };
|
class C;
|
class C;
|
struct D { A *d; };
|
struct D { A *d; };
|
struct E
|
struct E
|
{
|
{
|
B e1 (int) const;
|
B e1 (int) const;
|
A *e2 (const B &) const;
|
A *e2 (const B &) const;
|
D e3[4096];
|
D e3[4096];
|
};
|
};
|
|
|
inline A *
|
inline A *
|
E::e2 (const B & x) const
|
E::e2 (const B & x) const
|
{
|
{
|
const D *w = &e3[x.b2 ()];
|
const D *w = &e3[x.b2 ()];
|
return (A *) w->d;
|
return (A *) w->d;
|
}
|
}
|
|
|
extern E *e;
|
extern E *e;
|
|
|
inline A *
|
inline A *
|
B::b1 () const
|
B::b1 () const
|
{
|
{
|
extern E *e;
|
extern E *e;
|
return e->e2 (*this);
|
return e->e2 (*this);
|
}
|
}
|
|
|
template struct F : public B
|
template struct F : public B
|
{
|
{
|
F (const B &);
|
F (const B &);
|
T *b1 () const;
|
T *b1 () const;
|
};
|
};
|
|
|
template < class T > inline T * F ::b1 () const
|
template < class T > inline T * F ::b1 () const
|
{
|
{
|
return (T *) B::b1 ();
|
return (T *) B::b1 ();
|
};
|
};
|
|
|
typedef F N;
|
typedef F N;
|
|
|
class G {};
|
class G {};
|
class H : public G {};
|
class H : public G {};
|
class I : public H {};
|
class I : public H {};
|
class J {};
|
class J {};
|
class K {};
|
class K {};
|
struct L
|
struct L
|
{
|
{
|
void l (J *, C *, int, const char *, O);
|
void l (J *, C *, int, const char *, O);
|
};
|
};
|
class M : public K, public I
|
class M : public K, public I
|
{
|
{
|
void m (J &, int, const char *);
|
void m (J &, int, const char *);
|
void m (J &, int, int, const char *, float);
|
void m (J &, int, int, const char *, float);
|
};
|
};
|
|
|
void
|
void
|
M::m (J &x, int y, const char *z)
|
M::m (J &x, int y, const char *z)
|
{
|
{
|
L *w = new L;
|
L *w = new L;
|
N v = e->e1 (y);
|
N v = e->e1 (y);
|
w->l (&x, v.b1 (), P, z, Q);
|
w->l (&x, v.b1 (), P, z, Q);
|
}
|
}
|
|
|
void
|
void
|
M::m (J &x, int y, int s, const char *z, float t)
|
M::m (J &x, int y, int s, const char *z, float t)
|
{
|
{
|
L *w = new L;
|
L *w = new L;
|
N v = e->e1 (y);
|
N v = e->e1 (y);
|
w->l (&x, v.b1 (), s, z, (O) (int) ((t) ? (50 + 20 / (float) t) : 0));
|
w->l (&x, v.b1 (), s, z, (O) (int) ((t) ? (50 + 20 / (float) t) : 0));
|
}
|
}
|
|
|