public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amonakov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/95103] Unexpected -Wclobbered in bits/vector.tcc with -O2
Date: Thu, 14 May 2020 10:35:13 +0000	[thread overview]
Message-ID: <bug-95103-4-7a1SNhLHlt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95103-4@http.gcc.gnu.org/bugzilla/>

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)

  parent reply	other threads:[~2020-05-14 10:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 12:10 [Bug c++/95103] New: " sbergman at redhat dot com
2020-05-14  6:14 ` [Bug c++/95103] " rguenth at gcc dot gnu.org
2020-05-14  6:36 ` sbergman at redhat dot com
2020-05-14  9:33 ` amonakov at gcc dot gnu.org
2020-05-14 10:22 ` redi at gcc dot gnu.org
2020-05-14 10:35 ` amonakov at gcc dot gnu.org [this message]
2021-07-22 22:25 ` [Bug middle-end/95103] " pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-95103-4-7a1SNhLHlt@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).