OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [lambda/] [lambda-deduce-ext-neg2.C] - Rev 301

Compare with Previous | Blame | View Log

// Test that in pedantic mode, we warn about the extension to allow return
// type deduction when the lambda contains more than just a single
// return-statement.

// { dg-options "-std=c++0x -pedantic" }

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

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

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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