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++/104225] [9/10/11 Regression] accepts-invalid new expression that uses deleted implicit default constructor of class specialization Date: Tue, 12 Apr 2022 23:44:14 +0000 [thread overview] Message-ID: <bug-104225-4-wseQvblm2F@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104225-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104225 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:1429db66619d2b801ac0b586b5eed74ab54a35b0 commit r11-9840-g1429db66619d2b801ac0b586b5eed74ab54a35b0 Author: Patrick Palka <ppalka@redhat.com> Date: Tue Jan 25 15:04:49 2022 -0500 c++: deleted fn and noexcept inst [PR101532, PR104225] Here when attempting to use B's implicitly deleted default constructor, mark_used rightfully returns false, but for the wrong reason: it tries to instantiate the synthesized noexcept specifier which then only silently fails because get_defaulted_eh_spec suppresses diagnostics for deleted functions. This lack of diagnostics causes us to crash on the first testcase below (thanks to the assert in finish_expr_stmt), and silently accept the second testcase. To fix this, this patch makes mark_used avoid attempting to instantiate the noexcept specifier of a deleted function, so that we'll instead directly reject (and diagnose) the function due to its deletedness. PR c++/101532 PR c++/104225 gcc/cp/ChangeLog: * decl2.c (mark_used): Don't consider maybe_instantiate_noexcept on a deleted function. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-template21.C: New test. * g++.dg/cpp0x/nsdmi-template21a.C: New test. (cherry picked from commit bc90dd0ecf02e11d47d1af7f627e2e2acaa40106)
next prev parent reply other threads:[~2022-04-12 23:44 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-25 15:45 [Bug c++/104225] New: " ppalka at gcc dot gnu.org 2022-01-25 15:48 ` [Bug c++/104225] [9/10/11/12 Regression] " ppalka at gcc dot gnu.org 2022-01-25 20:05 ` cvs-commit at gcc dot gnu.org 2022-01-25 20:06 ` ppalka at gcc dot gnu.org 2022-01-25 20:07 ` [Bug c++/104225] [9/10/11 " ppalka at gcc dot gnu.org 2022-01-26 7:33 ` rguenth at gcc dot gnu.org 2022-04-12 23:44 ` cvs-commit at gcc dot gnu.org [this message] 2022-05-09 23:32 ` [Bug c++/104225] [9/10 " cvs-commit at gcc dot gnu.org 2022-05-11 14:59 ` [Bug c++/104225] [9 " cvs-commit at gcc dot gnu.org 2022-05-11 15:05 ` ppalka 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-104225-4-wseQvblm2F@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).