PR c++/82882 - ICE with lambda in template default argument.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-defarg8.C
blobcf842ad9dd1051e794479bb33cee19b1692b2e73
1 // PR c++/82282
2 // { dg-do compile { target c++14 } }
4 template<typename = int>
5 void f(const char* a =
6        ([](int = []{ static int i; return 42; }()) {
7           static int i;
8           return "";
9         }()));
11 template<typename = int>
12 struct X {
13   void f(const char* a =
14          ([](int = [] { static int i; return 42; }()) { 
15             enum { Size = 42 - 1 };
16             return "";
17           }()));
20 void g()
22   f();
23   X<int>().f();