c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / auto-fn27.C
blobb22647a38dee5c46d7be5418af177250c884e932
1 // PR c++/66919
2 // { dg-do compile { target c++14 } }
4 template <int>
5 struct A {
6   template <typename F, typename R, typename T>
7     static auto run (F fn, R, T) { auto r =  fn (); } // { dg-error "" }
8 };
9 template <typename F, typename T>
10 auto foo (F fn, T)
12   A <0>::run (fn, 0, 0);
14 struct B;
15 struct C {
16   typedef B D;
18 struct E {
19   virtual void bar (const int &);
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;
27 struct J { struct K {}; };
28 template <typename T>
29 void
30 F<T>::bar (const G &)
32   auto s = I;
33   typedef decltype (s) L;
34   auto u =[&](L) { auto t = foo (J::K (), 0); }; // { dg-error "25:incomplete|void" }
36 struct B {
37   typedef int G;
38   typedef int H;
40 struct M : F <C> {
41   M () {}