summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1y/pr79253.C
blob: b15efe8873f47b682396892c978dafa8fe0ba53f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// { dg-do compile { target c++14 } }
// PR 79253 ICE instantiating lambda body.

template <typename> struct A;
template <typename = A<int>> class B {};
template <class T, class U, class V> void foo (U, V) { T (0, 0); }
struct C {};
template <template <bool, bool, bool> class F, class>
void
bar ()
{
  F<0, 0, 0>::baz;
}
struct G { int l; };
template <int, int, int> struct E : C
{
  E (int, int) : e (0)
  {
    auto &m = this->m ();
    auto c = [&] { m.l; };
  }
  G &m ();
  int e;
};
struct D
{
  void
  baz () { bar<F, B<>>; }
  template <bool, bool, bool> struct F
  {
    static B<> baz () { foo<E<0, 0, 0>> (0, 0); }
  };
};