summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template10.C
blob: 4a804628728d9167737f9a055d3f08f07dabcd1a (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 "-std=c++11 -Wuninitialized" }
// { dg-do run }

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 ();
}
OpenPOWER on IntegriCloud