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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [named.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-options "--std=c++0x" }
2
// { dg-do link }
3
 
4
template
5
inline _Tp&&
6
movel(_Tp& __t)
7
{ return static_cast<_Tp&&>(__t); }
8
 
9
struct S {};
10
struct T
11
{
12
  T(S && s_) : s(movel(s_)) {}
13
  S && get() { return movel(s); }
14
  operator S&&() { return movel(s); }
15
  S && s;
16
};
17
 
18
void named(S const &) {}
19
void named(S&&);
20
 
21
void unnamed(S const &);
22
void unnamed(S&&) {}
23
 
24
void f(S && p)
25
{
26
  S && s(movel(p));
27
  T t(movel(s));
28
 
29
  named(s);                          // variable reference
30
  named(p);                          // parameter reference
31
  named(t.s);                        // class member access
32
 
33
  unnamed(t.get());                  // function return
34
  unnamed(t);                        // implicit conversion
35
  unnamed(static_cast(s));      // cast to rvalue
36
}
37
 
38
int main()
39
{
40
}

powered by: WebSVN 2.1.0

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