repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merged revisions 208012,208018-208019,208021,208023-208030,208033,208037,208040-20804...
[official-gcc.git]
/
main
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
rvo.C
blob
fc83b1b56f5a14610d882d7c1e47590a7dcb6506
1
// { dg-do run { target c++11 } }
2
// Contributed by Sylvain Pion
3
static int rvalue_constructions = 0;
4
5
struct A {
6
A () { }
7
A (const A&) { }
8
A (A&&) { ++rvalue_constructions; }
9
~A () { }
10
};
11
12
A f() { return A(); }
13
14
extern "C" {
15
void abort(void);
16
}
17
18
int main()
19
{
20
A c = f();
21
22
if (rvalue_constructions != 0)
23
abort();
24
}