Remove outermost loop parameter.
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / cpp0x / rvo.C
blobb52ce7495db3980c5cc5566cdff01a393b879e1d
1 // { dg-do "run" }
2 // { dg-options "-std=c++0x" }
3 // Contributed by Sylvain Pion
4 static int rvalue_constructions = 0;
6 struct A {
7   A ()         { }
8   A (const A&) { }
9   A (A&&)      { ++rvalue_constructions; }
10   ~A ()        { }
13 A f() {  return A(); }
15 extern "C" {
16   void abort(void);
19 int main()
21   A c = f();
23   if (rvalue_constructions != 0)
24     abort();