public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>
Cc: Nathan Sidwell <nathan@acm.org>,
	       Volker Reichelt <v.reichelt@netcologne.de>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] C++: Add fix-it hints for -Wold-style-cast
Date: Thu, 27 Apr 2017 22:05:00 -0000	[thread overview]
Message-ID: <20170427210337.GF4255@redhat.com> (raw)
In-Reply-To: <1493327424-21496-1-git-send-email-dmalcolm@redhat.com>

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

  parent reply	other threads:[~2017-04-27 21:03 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 [this message]
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
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=20170427210337.GF4255@redhat.com \
    --to=polacek@redhat.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    --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).