public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jason Merrill <jason@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-8586] c++: Tweak PR101029 fix Date: Thu, 17 Jun 2021 03:39:02 +0000 (GMT) [thread overview] Message-ID: <20210617033902.E4237383D02E@sourceware.org> (raw) https://gcc.gnu.org/g:da25516718cb150cc938f5947650c9ab486505c6 commit r11-8586-gda25516718cb150cc938f5947650c9ab486505c6 Author: Jason Merrill <jason@redhat.com> Date: Wed Jun 16 17:42:15 2021 -0400 c++: Tweak PR101029 fix The case of an initializer with side effects for a zero-length array seems extremely unlikely, but we should still return the right type in that case. PR c++/101029 gcc/cp/ChangeLog: * init.c (build_vec_init): Preserve the type of base. Diff: --- gcc/cp/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 6126440cfae..3c4aa5846d6 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -4226,7 +4226,7 @@ build_vec_init (tree base, tree maxindex, tree init, { /* Shortcut zero element case to avoid unneeded constructor synthesis. */ if (init && TREE_SIDE_EFFECTS (init)) - base = build2 (COMPOUND_EXPR, void_type_node, init, base); + base = build2 (COMPOUND_EXPR, ptype, init, base); return base; }
reply other threads:[~2021-06-17 3:39 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210617033902.E4237383D02E@sourceware.org \ --to=jason@gcc.gnu.org \ --cc=gcc-cvs@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).