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