[Bug c++/91819] [10 Regression] ICE when iterating over enum values

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 19 17:40:00 GMT 2019


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

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

diff --git gcc/cp/call.c gcc/cp/call.c
index b780b0af58e..b806faacf03 100644
--- gcc/cp/call.c
+++ gcc/cp/call.c
@@ -5878,7 +5885,10 @@ build_new_op_1 (const op_location_t &loc, enum tree_code
code, int flags,
     goto builtin;

   if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
-    arg2 = integer_zero_node;
+    {
+      arg2 = integer_zero_node;
+      arg2_type = integer_type_node;
+    }

   vec_alloc (arglist, 3);
   arglist->quick_push (arg1);


More information about the Gcc-bugs mailing list