public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Patrick Palka <ppalka@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/2] c++: casting array prvalue [PR112658, PR94264]
Date: Tue, 28 Nov 2023 16:32:45 -0500	[thread overview]
Message-ID: <d7ef7e8d-11bf-46bb-ac81-0daafe462f1b@redhat.com> (raw)
In-Reply-To: <20231128165112.2571430-1-ppalka@redhat.com>

On 11/28/23 11:51, Patrick Palka wrote:
> Bootstrapped and regtested on x86-64-pc-linux-gnu, does this look OK for
> trunk?
> 
> -- >8 --
> 
> Here we deem the array-to-pointer conversions in both calls as invalid,
> but we fail to issue a diagnostic for the second call, ultimately because
> cp_build_c_cast doesn't replay errors from build_const_cast_1.  This means
> the second call get silently discarded leading to wrong/unexpected code.
> 
> This patch fixes this issue.  I'm not sure if we want to accept these
> conversions in the first place (that's PR94264 or at least related to
> it), but at least we're more consistent now.

I've now fixed that bug, thanks for the pointer.

The cp_build_c_cast change is OK, but the testcase won't error anymore. 
Do you have an idea for an alternate test?  If not, it's OK to apply the 
fix anyway.

Jason


      parent reply	other threads:[~2023-11-28 21:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 16:51 Patrick Palka
2023-11-28 16:51 ` [PATCH 2/2] c++: guard more against undiagnosed error_mark_node [PR112658] Patrick Palka
2023-11-28 21:33   ` Jason Merrill
2023-11-28 21:32 ` Jason Merrill [this message]

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=d7ef7e8d-11bf-46bb-ac81-0daafe462f1b@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ppalka@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).