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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [rv-trivial-bug.C] - Blame information for rev 774

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
// PR c++/33235
3
#include 
4
 
5
int move_construct = 0;
6
int move_assign = 0;
7
 
8
struct base2                    // { dg-message "declares a move" }
9
{
10
    base2() {}
11
    base2(base2&&) {++move_construct;}
12
    base2& operator=(base2&&) {++move_assign; return *this;}
13
};
14
 
15
int test2()
16
{
17
    base2 b;
18
    base2 b2(b);                // { dg-error "deleted" }
19
    assert(move_construct == 0);
20
    base2 b3(static_cast(b));
21
    base2 b4 = static_cast(b);
22
    assert(move_construct == 2);
23
    b = b2;                     // { dg-error "deleted" }
24
    assert(move_assign == 0);
25
    b = static_cast(b2);
26
    assert(move_assign == 1);
27
}
28
 
29
int main()
30
{
31
    test2();
32
    return 0;
33
}

powered by: WebSVN 2.1.0

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