public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/112301] [Regression 12/13/14] Double destruction of returned object when exiting the scope causes an exception which gets rethrown
Date: Mon, 30 Oct 2023 16:29:37 +0000	[thread overview]
Message-ID: <bug-112301-4-MTp8NB30dY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112301-4@http.gcc.gnu.org/bugzilla/>

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
            Summary|Double destruction of       |[Regression 12/13/14]
                   |returned object when        |Double destruction of
                   |exiting the scope causes an |returned object when
                   |exception which gets        |exiting the scope causes an
                   |rethrown                    |exception which gets
                   |                            |rethrown
                 CC|                            |jason at gcc dot gnu.org
   Last reconfirmed|                            |2023-10-30
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed as a regression starting with r12-6333-gb10e031458d541

Author: Jason Merrill
Date:   Wed Jan 5 22:01:12 2022

    c++: destroy retval on throwing cleanup in try [PR33799]

    My earlier attempt to fix this bug didn't handle the case where both the
    return and the throwing cleanup are within a try-block that catches and
    discards the exception.  Fixed by adding the retval cleanup to any
    try-blocks as well as the function body.  PR102191 pointed out that we also
    weren't handling templates properly, so I moved the call out of the parser.

            PR c++/33799
            PR c++/102191

  reply	other threads:[~2023-10-30 16:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 16:14 [Bug c++/112301] New: " alexander.grund@tu-dresden.de
2023-10-30 16:29 ` redi at gcc dot gnu.org [this message]
2023-10-30 21:45 ` [Bug c++/112301] [Regression 12/13/14] " jason at gcc dot gnu.org
2023-11-02 20:01 ` [Bug c++/112301] [12/13/14 regression] Double destruction of returned object when exiting the scope causes an exception which gets rethrown since r12-6333-gb10e031458d541 cvs-commit at gcc dot gnu.org
2023-11-02 20:03 ` jason at gcc dot gnu.org
2023-11-03 10:01 ` alexander.grund@tu-dresden.de
2023-11-17  0:21 ` cvs-commit at gcc dot gnu.org
2023-11-17  0:21 ` cvs-commit at gcc dot gnu.org
2024-01-12  8:27 ` rguenth at gcc dot gnu.org
2024-01-12  8:32 ` pinskia at gcc dot gnu.org
2024-03-04  4:26 ` law 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-112301-4-MTp8NB30dY@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).