From: Paolo Carlini <paolo.carlini@oracle.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Jason Merrill <jason@redhat.com>
Subject: [C++ Patch] PR 71577 ("[6/7/8 regression] ICE on invalid C++11 code (with extra struct initializer): in digest_init_r...")
Date: Fri, 28 Apr 2017 11:27:00 -0000 [thread overview]
Message-ID: <0e71a2d6-ae7b-36dd-a9e5-c50c207f8a35@oracle.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 363 bytes --]
Hi,
now that 7.1.0 is almost out of the door, I'm sending a few simple
patches which I have been testing for a while in my trees. This one is
about an error recovery regression: I think it's correct to handle it by
simply returning unconditionally error_mark_node upon "too many
initializers" error. Tested x86_64-linux.
Thanks, Paolo.
//////////////////
[-- Attachment #2: CL_71577 --]
[-- Type: text/plain, Size: 292 bytes --]
/cp
2017-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71577
* decl.c (reshape_init): Unconditionally return error_mark_node
upon error about too many initializers.
/testsuite
2017-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71577
* g++.dg/cpp0x/pr71577.C: New.
[-- Attachment #3: patch_71577 --]
[-- Type: text/plain, Size: 790 bytes --]
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 247273)
+++ cp/decl.c (working copy)
@@ -6118,8 +6118,7 @@ reshape_init (tree type, tree init, tsubst_flags_t
{
if (complain & tf_error)
error ("too many initializers for %qT", type);
- else
- return error_mark_node;
+ return error_mark_node;
}
if (CONSTRUCTOR_IS_DIRECT_INIT (init)
Index: testsuite/g++.dg/cpp0x/pr71577.C
===================================================================
--- testsuite/g++.dg/cpp0x/pr71577.C (revision 0)
+++ testsuite/g++.dg/cpp0x/pr71577.C (working copy)
@@ -0,0 +1,4 @@
+// PR c++/71577
+// { dg-do compile { target c++11 } }
+
+struct { int a; } s1, s2 = { s1, 0 }; // { dg-error "too many initializers" }
next reply other threads:[~2017-04-28 10:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 11:27 Paolo Carlini [this message]
2017-04-28 14:52 ` Nathan Sidwell
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=0e71a2d6-ae7b-36dd-a9e5-c50c207f8a35@oracle.com \
--to=paolo.carlini@oracle.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/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).