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

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: Implicit cast to rvalue when eliding copy
4
 
5
// { dg-do compile }
6
// { dg-options "-std=c++0x" }
7
 
8
template  struct sa;
9
template <> struct sa {};
10
 
11
struct one   {char x[1];};
12
struct two   {char x[2];};
13
 
14
class move_only
15
{
16
    move_only(const move_only&); // { dg-error "is private" }
17
    move_only& operator=(const move_only&);
18
public:
19
    move_only() {}
20
    move_only(move_only&&) {}
21
    move_only& operator=(move_only&&) {return *this;}
22
};
23
 
24
move_only
25
test1()
26
{
27
    static move_only x;
28
    return x;  //  { dg-error "within this context" }
29
}
30
 
31
move_only
32
test2(move_only&& x)
33
{
34
    return x;  //  { dg-error "within this context" }
35
}
36
 
37
int main()
38
{
39
    move_only t1 = test1();
40
    move_only t2 = test2(move_only());
41
    return 0;
42
}
43
 
44
bool b = true;

powered by: WebSVN 2.1.0

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