OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [lambda/] [lambda-deduce-ext-neg2.C] - Blame information for rev 307

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// Test that in pedantic mode, we warn about the extension to allow return
2
// type deduction when the lambda contains more than just a single
3
// return-statement.
4
 
5
// { dg-options "-std=c++0x -pedantic" }
6
 
7
bool b;
8
template 
9
T f (T t)
10
{
11
  [=] { return t+1; };          // OK
12
  return [=] {
13
    auto i = t+1;
14
    return i+1;                 // { dg-warning "only statement" }
15
  }();
16
}
17
 
18
int main()
19
{
20
  if (f(1) != 3)
21
    return 1;
22
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.