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++/101532] [12 Regression] ICE in finish_expr_stmt, at cp/semantics.c:859
Date: Tue, 12 Apr 2022 23:44:14 +0000	[thread overview]
Message-ID: <bug-101532-4-aog8V27M4k@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101532-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 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)

  parent reply	other threads:[~2022-04-12 23:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 16:52 [Bug c++/101532] New: " gscfq@t-online.de
2021-07-20 16:57 ` [Bug c++/101532] " mpolacek at gcc dot gnu.org
2021-07-20 17:00 ` mpolacek at gcc dot gnu.org
2022-01-10 12:13 ` pinskia at gcc dot gnu.org
2022-01-20 12:42 ` rguenth 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-04-12 23:44 ` cvs-commit at gcc dot gnu.org [this message]
2022-04-12 23:47 ` ppalka at gcc dot gnu.org
2022-05-09 23:32 ` cvs-commit at gcc dot gnu.org
2022-05-11 14:59 ` 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-101532-4-aog8V27M4k@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).