https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95103

--- Comment #5 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
No, this analogy does not work. setjmp both sets up a buffer and receives
control, so it corresponds to both try and catch together. A matching "C++"
code would look like:

> void f3() {
>     std::vector<S> v;
>     for (int i = 0; i != 2; ++i) {
>         if (!f2("xx")) f1();
>         v.push_back(0);
>     }
>     try {
>     catch (...) {
>     }
> }

where it's evident that v does not leave scope and its desctructor cannot be
reached.

(comment #1 and #3 still stand)

Reply via email to