/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / pr79253.C
blob181702acc5b1287750916b6e6fd62a02aafb55de
1 // { dg-do compile { target c++14 } }
2 // PR 79253 ICE instantiating lambda body.
4 template <typename> struct A;
5 template <typename = A<int>> class B {};
6 template <class T, class U, class V> void foo (U, V) { T (0, 0); }
7 struct C {};
8 template <template <bool, bool, bool> class F, class>
9 void
10 bar ()
12   F<0, 0, 0>::baz;
14 struct G { int l; };
15 template <int, int, int> struct E : C
17   E (int, int) : e (0)
18   {
19     auto &m = this->m ();
20     auto c = [&] { m.l; };
21   }
22   G &m ();
23   int e;
25 struct D
27   void
28   baz () { bar<F, B<>>; }
29   template <bool, bool, bool> struct F
30   {
31     static B<> baz () { foo<E<0, 0, 0>> (0, 0); return B<>(); }
32   };