public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Martin Sebor <msebor@gmail.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] handle MEM_REF with void* arguments (PR c++/95768)
Date: Mon, 22 Jun 2020 14:55:06 -0400	[thread overview]
Message-ID: <f1789f51-6828-56ef-8224-e1bc4dd7c858@redhat.com> (raw)
In-Reply-To: <ff44a764-a42b-c78a-0b30-8aace0cb9939@gmail.com>

On 6/22/20 1:25 PM, Martin Sebor wrote:
> The attached fix parallels the one for the equivalent C bug 95580
> where the pretty printers don't correctly handle MEM_REF arguments
> with type void* or other pointers to an incomplete type.
> 
> The incorrect handling was exposed by the recent change to
> -Wuninitialized which includes such expressions in diagnostics.

> +		if (tree size = TYPE_SIZE_UNIT (TREE_TYPE (argtype)))
> +		  if (!integer_onep (size))
> +		    {
> +		      pp_cxx_left_paren (pp);
> +		      dump_type (pp, ptr_type_node, flags);
> +		      pp_cxx_right_paren (pp);
> +		    }

Don't we want to print the cast if the pointer target type is incomplete?

Jason


  reply	other threads:[~2020-06-22 18:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 17:25 Martin Sebor
2020-06-22 18:55 ` Jason Merrill [this message]
2020-06-22 22:22   ` Martin Sebor
2020-06-23  7:12     ` Richard Biener
2020-06-28 23:07       ` Martin Sebor
2020-06-29  7:19         ` Richard Biener
2020-07-09 15:50           ` Martin Sebor
2021-01-02 22:22             ` [PATCH v3] " Martin Sebor
2021-01-05 23:17               ` Jeff Law
2021-01-07  8:26               ` Jakub Jelinek
2021-01-07 21:36                 ` Martin Sebor

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=f1789f51-6828-56ef-8224-e1bc4dd7c858@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.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).