This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] PR c++/90590 Suppress warning for enumeration value not handled in switch warning
- From: Jason Merrill <jason at redhat dot com>
- To: Matthew Beliveau <mbelivea at redhat dot com>, gcc-patches at gcc dot gnu dot org, Marek Polacek <polacek at redhat dot com>
- Date: Tue, 9 Jul 2019 17:21:35 -0400
- Subject: Re: [C++ PATCH] PR c++/90590 Suppress warning for enumeration value not handled in switch warning
- References: <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