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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [lambda/] [lambda-deduce-ext.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Testcase for an extension to allow return type deduction when the lambda
2
// contains more than just a single return-statement.
3
 
4
// { dg-options -std=c++0x }
5
// { dg-do run }
6
 
7
bool b;
8
template 
9
T f (T t)
10
{
11
  return [=] {
12
    auto i = t+1;
13
    if (b)
14
      return i+1;
15
    else
16
      return i+1;
17
  }();
18
}
19
 
20
int main()
21
{
22
  // Pointless, but well-formed.
23
  [] { return 1; return 2; }();
24
 
25
  if (f(1) != 3)
26
    return 1;
27
}

powered by: WebSVN 2.1.0

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