public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>
Cc: Nathan Sidwell <nathan@acm.org>,
	Marek Polacek <polacek@redhat.com>,
		Volker Reichelt <v.reichelt@netcologne.de>,
	gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH v2] C++: Add fix-it hints for -Wold-style-cast
Date: Tue, 20 Jun 2017 18:39:00 -0000	[thread overview]
Message-ID: <CADzB+2kdSgyYVJXYY_125ZaFgQdz4FOykb_mSdw66g0gM+JMaA@mail.gmail.com> (raw)
In-Reply-To: <1493819469-38154-1-git-send-email-dmalcolm@redhat.com>

On Wed, May 3, 2017 at 9:51 AM, David Malcolm <dmalcolm@redhat.com> wrote:
> On Thu, 2017-04-27 at 23:03 +0200, Marek Polacek wrote:
>> On Thu, Apr 27, 2017 at 05:10:24PM -0400, David Malcolm wrote:
>> > +  /* First try const_cast.  */
>> > +  trial = build_const_cast (dst_type, orig_expr, 0 /* complain
>> > */);
>> > +  if (trial != error_mark_node)
>> > +    return "const_cast";
>> > +
>> > +  /* If that fails, try static_cast.  */
>> > +  trial = build_static_cast (dst_type, orig_expr, 0 /* complain
>> > */);
>> > +  if (trial != error_mark_node)
>> > +    return "static_cast";
>> > +
>> > +  /* Finally, try reinterpret_cast.  */
>> > +  trial = build_reinterpret_cast (dst_type, orig_expr, 0 /*
>> > complain */);
>> > +  if (trial != error_mark_node)
>> > +    return "reinterpret_cast";
>>
>> I think you'll want tf_none instead of 0 /* complain */ in these.
>>
>>       Marek
>
> Thanks.
>
> Here's an updated version of the patch.
>
> Changes since v1:
> - updated expected fixit-formatting (the new fix-it printer in
>   r247548 handles this properly now)
> - added new test cases as suggested by Florian
> - use "tf_none" rather than "0 /* complain */"
>
> Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.
>
> OK for trunk?

OK.

Jason

  parent reply	other threads:[~2017-06-20 18:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  8:00 [PATCH] Improved diagnostics for casts and enums Volker Reichelt
2017-04-27 12:37 ` Nathan Sidwell
2017-04-27 20:58   ` [PATCH] C++: Add fix-it hints for -Wold-style-cast David Malcolm
2017-04-27 21:05     ` Florian Weimer
2017-04-27 22:05     ` Marek Polacek
2017-05-03 13:32       ` [PATCH v2] " David Malcolm
2017-05-26 19:54         ` [PING] re " David Malcolm
2017-06-05 16:41           ` [PING^2] " David Malcolm
2017-06-20 14:03             ` [PING^3] " David Malcolm
2017-06-20 18:39         ` Jason Merrill [this message]
2017-04-27 16:59 ` [PATCH] Improved diagnostics for casts and enums Martin Sebor
2017-04-28  8:42   ` Volker Reichelt
2017-04-30 17:54     ` Volker Reichelt
2017-06-20 16:10       ` Martin Sebor
2017-07-10 16:01         ` [PING #2] " 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=CADzB+2kdSgyYVJXYY_125ZaFgQdz4FOykb_mSdw66g0gM+JMaA@mail.gmail.com \
    --to=jason@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    --cc=polacek@redhat.com \
    --cc=v.reichelt@netcologne.de \
    /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).