struct x { int foo () {} }; template struct vector { T& bar () {} }; template struct y { typedef struct { x t; } s; vector array; int foo () { return array.bar().t.foo(); } }; int i = y().foo ();