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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 693 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
  S s2;
17
};
18
 
19
void named(S const &) {}
20
void named(S&&);
21
 
22
void unnamed(S const &);
23
void unnamed(S&&) {}
24
 
25
void f(S && p)
26
{
27
  S && s(movel(p));
28
  T t(movel(s));
29
 
30
  named(s);                          // variable reference
31
  named(p);                          // parameter reference
32
  named(t.s);                        // class member access
33
 
34
  unnamed(t.get());                  // function return
35
  unnamed(t);                        // implicit conversion
36
  unnamed(static_cast(s));      // cast to rvalue
37
  unnamed(static_cast(t).s2);   // cast to rvalue
38
}
39
 
40
int main()
41
{
42
}

powered by: WebSVN 2.1.0

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