1 // { dg-do run } 2 // Test that we clean up temporaries bound to references properly when 3 // jumping out of their scope. 4 5 int ret = 1; 6 7 struct A 8 { ~AA9 ~A() { ret = 0; } 10 }; 11 f()12void f() 13 { 14 if (0) 15 { 16 out: 17 return; 18 } 19 const A& a = A(); 20 goto out; 21 } 22 main()23int main() 24 { 25 f(); 26 return ret; 27 } 28