public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102191] [C++20] Can't return prvalue with potentially-throwing destructor during constant evaluation Date: Fri, 07 Jan 2022 00:26:07 +0000 [thread overview] Message-ID: <bug-102191-4-SniG1r8iGr@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102191-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102191 --- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:b10e031458d541f794dfaa08ba606487603a4bb6 commit r12-6333-gb10e031458d541f794dfaa08ba606487603a4bb6 Author: Jason Merrill <jason@redhat.com> Date: Wed Jan 5 17:01:12 2022 -0500 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 gcc/cp/ChangeLog: * except.c (maybe_splice_retval_cleanup): Check current_binding_level. * semantics.c (do_poplevel): Call it here. * parser.c (cp_parser_compound_statement): Not here. gcc/testsuite/ChangeLog: * g++.dg/eh/return1.C: Add temporary in try block case. * g++.dg/cpp2a/constexpr-dtor11.C: New test.
next prev parent reply other threads:[~2022-01-07 0:26 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-03 14:57 [Bug c++/102191] New: " johelegp at gmail dot com 2022-01-06 2:08 ` [Bug c++/102191] [C++20] " jason at gcc dot gnu.org 2022-01-07 0:26 ` cvs-commit at gcc dot gnu.org [this message] 2022-02-01 22:51 ` jason at gcc dot gnu.org 2023-11-02 20:01 ` cvs-commit at gcc dot gnu.org 2023-11-17 0:21 ` cvs-commit at gcc dot gnu.org 2023-11-17 0:21 ` cvs-commit 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-102191-4-SniG1r8iGr@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: linkBe 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).