https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98043

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.0                        |8.5

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Candidate fix:

--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3711,6 +3711,10 @@ pop_switch (void)
     SWITCH_STMT_ALL_CASES_P (cs->switch_stmt) = 1;
   if (!cs->break_stmt_seen_p)
     SWITCH_STMT_NO_BREAK_P (cs->switch_stmt) = 1;
+  if (SWITCH_STMT_TYPE (cs->switch_stmt)
+      && SCOPED_ENUM_P (SWITCH_STMT_TYPE (cs->switch_stmt)))
+    SWITCH_STMT_TYPE (cs->switch_stmt)
+      = TREE_TYPE (SWITCH_STMT_COND (cs->switch_stmt));
   gcc_assert (!cs->in_loop_body_p);
   splay_tree_delete (cs->cases);
   switch_stack = switch_stack->next;

Reply via email to