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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [unnamed_refs.C] - Blame information for rev 707

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

Line No. Rev Author Line
1 693 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
struct one   {long x[1];};
12
struct two   {long x[2];};
13
 
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
    sa t1;
29
    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.