+2019-08-01 Matthew Beliveau <mbelivea@redhat.com>
+
+ PR c++/90590
+ * c-warn.c (c_do_switch_warnings): Suppress warning for enumerators
+ with reserved names that are in a system header.
+
2019-08-01 Uroš Bizjak <ubizjak@gmail.com>
* config/i386/mmx.md (vec_extractv2si_0): Add (r,x) alternative.
#include "gcc-rich-location.h"
#include "gimplify.h"
#include "c-family/c-indentation.h"
+#include "c-family/c-spellcheck.h"
#include "calls.h"
#include "stor-layout.h"
if (cond && tree_int_cst_compare (cond, value))
continue;
+ /* If the enumerator is defined in a system header and uses a reserved
+ name, then we continue to avoid throwing a warning. */
+ location_t loc = DECL_SOURCE_LOCATION
+ (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (type)));
+ if (in_system_header_at (loc)
+ && name_reserved_for_implementation_p
+ (IDENTIFIER_POINTER (TREE_PURPOSE (chain))))
+ continue;
+
/* If there is a default_node, the only relevant option is
Wswitch-enum. Otherwise, if both are enabled then we prefer
to warn using -Wswitch because -Wswitch is enabled by -Wall
+2019-08-01 Matthew Beliveau <mbelivea@redhat.com>
+
+ PR c++/90590
+ * c-c++-common/pr90590-1.c: New test.
+ * c-c++-common/pr90590-1.h: New test.
+ * c-c++-common/pr90590-2.c: New test.
+ * c-c++-common/pr90590-2.h: New test.
+
2019-08-01 Marek Polacek <polacek@redhat.com>
PR c++/90805 - detect narrowing in case values.