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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [auto22.C] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/47999
2
// { dg-options -std=c++0x }
3
 
4
int& identity(int& i)
5
{
6
  return i;
7
}
8
 
9
// In a function template, auto type deduction works incorrectly.
10
template 
11
void f()
12
{
13
  int i = 0;
14
  auto&& x = identity(i); // Type of x should be `int&`, but it is `int&&`.
15
}
16
 
17
int main (int argc, char* argv[])
18
{
19
  f();
20
  return 0;
21
}

powered by: WebSVN 2.1.0

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