public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Matthew Beliveau <mbelivea@redhat.com>,
	gcc-patches@gcc.gnu.org, Marek Polacek <polacek@redhat.com>
Subject: Re: [C++ PATCH] PR c++/90590 Suppress warning for enumeration value not handled in switch warning
Date: Tue, 09 Jul 2019 21:23:00 -0000	[thread overview]
Message-ID: <f8438839-125f-f006-1665-cd0d74ecd38f@redhat.com> (raw)
In-Reply-To: <CAOrE4X2ZKktGOw=LERUgu7sMkMQE04fwH8Lw7vNWu=1BKYpcFA@mail.gmail.com>

On 7/9/19 11:18 AM, Matthew Beliveau wrote:
> This patch suppresses the warning:  "enumeration value not handled in
> switch", for enumerators that are defined in system headers and use
> reserved names.

> +      if (decl == NULL_TREE)
> +	decl = lookup_name (TREE_PURPOSE (chain));

This seems likely to find an unrelated declaration.  If we have a name 
without a decl, I think it would be better to just look at that name 
rather than try to find the corresponding decl.  For location, we can 
use the location of the type.

Jason

  parent reply	other threads:[~2019-07-09 21:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09 15:53 Matthew Beliveau
2019-07-09 17:48 ` Marek Polacek
2019-07-09 21:23 ` Jason Merrill [this message]
2019-07-12 18:39   ` Matthew Beliveau
2019-07-12 18:41     ` Marek Polacek
2019-07-12 23:00       ` Marek Polacek
2019-07-15 14:17         ` Matthew Beliveau
2019-07-16 12:42           ` Marek Polacek
2019-07-23 15:33             ` Matthew Beliveau
2019-07-30 19:46               ` Matthew Beliveau
2019-07-31 18:58           ` Jason Merrill

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=f8438839-125f-f006-1665-cd0d74ecd38f@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mbelivea@redhat.com \
    --cc=polacek@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).