This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] PR c++/90590 Suppress warning for enumeration value not handled in switch warning


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]