blob: fc83b1b56f5a14610d882d7c1e47590a7dcb6506 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// { dg-do run { target c++11 } }
// Contributed by Sylvain Pion
static int rvalue_constructions = 0;
struct A {
A () { }
A (const A&) { }
A (A&&) { ++rvalue_constructions; }
~A () { }
};
A f() { return A(); }
extern "C" {
void abort(void);
}
int main()
{
A c = f();
if (rvalue_constructions != 0)
abort();
}
|