1 // Test for the named return value optimization, this time with inlining. 2 // { dg-do run } 3 // { dg-options -O2 } 4 5 int c; 6 int d; 7 8 struct A 9 { AA10 A() { ++c; } AA11 A(const A&) { ++c; }; ~AA12 ~A() { ++d; } 13 }; 14 f()15inline A f () 16 { 17 A a; 18 return a; 19 } 20 main()21int main () 22 { 23 { 24 A a = f (); 25 } 26 27 return !(c == 1 && c == d); 28 } 29