aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce-ext-neg2.C
blob: fdbb4e1e377de3315e2054dece6feef2308865c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test that this is accepted even when pedantic now that it's part
// of the standard.

// { dg-do compile { target c++11 } }
// { dg-options "-pedantic" }

bool b;
template <class T>
T f (T t)
{
  [=] { return t+1; };		// OK
  return [=] {
    auto i = t+1;
    return i+1;
  }();
}

int main()
{
  if (f(1) != 3)
    return 1;
}