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++/94475] [9/10 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in element_mode, at tree.c:13813
Date: Thu, 16 Apr 2020 12:59:22 +0000	[thread overview]
Message-ID: <bug-94475-4-RN0yhfpNcq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94475-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:effcb4181e143bc390286a489ff849768a49f6af

commit r10-7757-geffcb4181e143bc390286a489ff849768a49f6af
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed Apr 15 12:47:41 2020 -0400

    c++: Error recovery with erroneous DECL_INITIAL [PR94475]

    Here we're ICE'ing in do_narrow during error-recovery, because ocp_convert
    returns error_mark_node after it attempts to reduce a const decl to its
    erroneous DECL_INITIAL via scalar_constant_value, and we later pass this
    error_mark_node to fold_build2 which isn't prepared to handle
error_mark_nodes.

    We could fix this ICE in do_narrow by checking if ocp_convert returns
    error_mark_node, but for the sake of consistency and for better error
recovery
    it seems it'd be preferable if ocp_convert didn't care that a const decl's
    initializer is erroneous and would instead proceed as if the decl was not
const,
    which is the approach that this patch takes.

    gcc/cp/ChangeLog:

            PR c++/94475
            * cvt.c (ocp_convert): If the result of scalar_constant_value is
            erroneous, ignore it and use the original expression.

    gcc/testsuite/ChangeLog:

            PR c++/94475
            * g++.dg/conversion/err-recover2.C: New test.
            * g++.dg/diagnostic/pr84138.C: Remove now-bogus warning.
            * g++.dg/warn/Wsign-compare-8.C: Remove now-bogus warning.

  parent reply	other threads:[~2020-04-16 12:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 17:07 [Bug c++/94475] New: [10 " asolokha at gmx dot com
2020-04-03 17:09 ` [Bug c++/94475] " mpolacek at gcc dot gnu.org
2020-04-03 17:13 ` [Bug c++/94475] [9/10 " mpolacek at gcc dot gnu.org
2020-04-06  6:31 ` rguenth at gcc dot gnu.org
2020-04-15  1:02 ` ppalka at gcc dot gnu.org
2020-04-16 12:59 ` cvs-commit at gcc dot gnu.org [this message]
2020-04-16 13:00 ` [Bug c++/94475] [9 " ppalka at gcc dot gnu.org
2021-04-21 14:43 ` 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-94475-4-RN0yhfpNcq@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).