1 // PR c++/66919
2 // { dg-do compile { target c++14 } }
3 
4 template <int>
5 struct A {
6   template <typename F, typename R, typename T>
runA7     static auto run (F fn, R, T) { auto r =  fn (); } // { dg-error "" }
8 };
9 template <typename F, typename T>
foo(F fn,T)10 auto foo (F fn, T)
11 {
12   A <0>::run (fn, 0, 0);
13 }
14 struct B;
15 struct C {
16   typedef B D;
17 };
18 struct E {
19   virtual void bar (const int &);
20 };
21 template <typename C>
22 struct F : E {
23   typedef typename C::D::G G;
24   void bar (const G &);
25   typename C::D::H I;
26 };
27 struct J { struct K {}; };
28 template <typename T>
29 void
bar(const G &)30 F<T>::bar (const G &)
31 {
32   auto s = I;
33   typedef decltype (s) L;
34   auto u =[&](L) { auto t = foo (J::K (), 0); }; // { dg-error "25:declared void" }
35 }
36 struct B {
37   typedef int G;
38   typedef int H;
39 };
40 struct M : F <C> {
MM41   M () {}
42 };
43