// PR c++/66919 // { dg-do compile { target c++14 } } template struct A { template static auto run (F fn, R, T) { auto r = fn (); } // { dg-error "" } }; template auto foo (F fn, T) { A <0>::run (fn, 0, 0); } struct B; struct C { typedef B D; }; struct E { virtual void bar (const int &); }; template struct F : E { typedef typename C::D::G G; void bar (const G &); typename C::D::H I; }; struct J { struct K {}; }; template void F::bar (const G &) { auto s = I; typedef decltype (s) L; auto u =[&](L) { auto t = foo (J::K (), 0); }; // { dg-error "25:incomplete|void" } } struct B { typedef int G; typedef int H; }; struct M : F { M () {} };