aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template10.C
blob: 4fcc965275131235b14fd22467c80425d2587a30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/50276
// { dg-options "-Wuninitialized" }
// { dg-do run { target c++11 } }

template<typename T>
unsigned testfun(const T& func)
{
  return func();
}

template<int i>
unsigned test()
{
  if (unsigned value = testfun( [] () { return 0; }))
    return value;
  return i;
}

int main()
{
  if (test<42>() != 42)
    __builtin_abort ();
}