Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-template10.C
1 // PR c++/50276
2 // { dg-options "-std=c++11 -Wuninitialized" }
3 // { dg-do run }
4
5 template<typename T>
6 unsigned testfun(const T& func)
7 {
8   return func();
9 }
10
11 template<int i>
12 unsigned test()
13 {
14   if (unsigned value = testfun( [] () { return 0; }))
15     return value;
16   return i;
17 }
18
19 int main()
20 {
21   if (test<42>() != 42)
22     __builtin_abort ();
23 }