1 // { dg-do run } 2 int count; 3 4 struct base { basebase5 base () { ++count; } ~basebase6 ~base () { --count; } basebase7 base(const base&o) { ++count; } 8 }; 9 10 base base_returning_function (); 11 12 const base& base_ref = base_returning_function (); 13 main()14int main () { 15 if (count != 1) 16 return 1; 17 } 18 base_returning_function()19base base_returning_function () { 20 base local_base_object; 21 return local_base_object; 22 } 23