PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-template2.C
blob29f63afe0df415dd22a78b24eb74cde08fef174b
1 // PR c++/47049
2 // { dg-do compile { target c++11 } }
4 enum { E = 0, F = 1 };
5 template <int N, int M = ((N == 1) ? F : E)> class S {};
6 template <int N>
7 struct T
9   static void
10   foo (S<N> *p)
11   {
12     S<N> u;
13     [&u] ()->bool {} ();
14   }
17 int main()
19   T<0>().foo(0);