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 r12-1548] c++: Tweak PR101029 fix
Date: Thu, 17 Jun 2021 03:38:40 +0000 (GMT)	[thread overview]
Message-ID: <20210617033840.F0702383A810@sourceware.org> (raw)

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

commit r12-1548-gff4deb4b1d0c5947669ddc76fde4db83e28009d8
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 622d6e9d0c5..4bd942f3f74 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:38 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=20210617033840.F0702383A810@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: 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).