[Bug c++/92407] New: Destruction of objects returned from functions skipped by goto

2019-11-07 Thread Dave.Poston at gs dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: Dave.Poston at gs dot com Target Milestone: --- The code below only outputs 'Destructed' once: Godbolt link: https://godbolt.org/z/Foy-vc Bug appears to be present in all versi

[Bug c++/92407] Destruction of objects returned from functions skipped by goto

2019-11-07 Thread Dave.Poston at gs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92407 --- Comment #1 from Dave Poston --- In fact, fill() isn't even needed. Smaller repro: https://godbolt.org/z/ubXl7Y --- #include struct MyStruct { MyStruct() { std::cout << "Constructed" << std::endl; } ~

[Bug c++/92407] Destruction of objects returned from functions skipped by goto

2019-11-07 Thread Dave.Poston at gs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92407 --- Comment #4 from Dave Poston --- Yep, also changing problem()/foo() to void and not returning the struct, works properly