// PR debug/48967 // { dg-do compile } // { dg-options "-g -O2" } template struct A; template struct A { typedef T ref; }; template struct B { typedef A t; typedef typename t::ref ref; ref operator * () { return ref (); } }; template struct I { typedef T *cp; template struct J { typedef I other; }; }; template struct S : public I { }; template struct E { typedef typename _A::template J ::other at; }; template > struct D { typedef E _Base; typedef typename _Base::at at; typedef typename at::cp cp; typedef B H; }; template struct F { T *operator -> () { return __null; } }; template long lfloor (T x) { return static_cast (x) - (x && x != static_cast (x)); } template long lround (T x) { return lfloor (x - 0.5) + 1; } class M; template class P; typedef P Q; template struct P { float x (); }; struct CV { Q c; }; struct C { void foo (const CV &) const; class O; typedef D > R; R n; }; struct S3 { S3 (int, int); }; struct S2 { S3 sx, sy; S2 (int x = 0, int y = 0, int s = 0, int t = 0) : sx (x, y), sy (s, t) {} }; template struct N { int bar (); }; struct C::O { N o; void foo (CV r, int) { Q c = r.c; float t = 0.5 * (o.bar ()); S2 (lround (c.x ()), t); } }; void C::foo (const CV &w) const { R::H m; (*m)->foo (w, 8); }