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/] [unnamed_refs.C] - Blame information for rev 378

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// I, Howard Hinnant, hereby place this code in the public domain.
2
 
3
// Test: Unamed rvalue references are treated as lvalues.
4
 
5
// { dg-do compile }
6
// { dg-options "-std=c++0x" }
7
 
8
template  struct sa;
9
template <> struct sa {};
10
 
11 378 julius
struct one   {long x[1];};
12
struct two   {long x[2];};
13 301 jeremybenn
 
14
struct A {};
15
 
16
one foo(const A&) {return one();}
17
two foo(A&&)      {return two();}
18
 
19
template
20
inline _Tp&&
21
movel(_Tp& __t)
22
{ return static_cast<_Tp&&>(__t); }
23
 
24
A&& source() {static A a; return movel(a);}
25
 
26
int test1()
27
{
28 378 julius
    sa t1;
29 301 jeremybenn
    return 0;
30
}
31
 
32
int main()
33
{
34
    return test1();
35
}

powered by: WebSVN 2.1.0

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