On 9/19/19 3:40 PM, Marek Polacek wrote:
This is an ICE that started with the recent r275745.  The problem here is that
for a POSTINCREMENT_EXPR build_new_op_1 is called with null arg2, so arg2_type 
is
also null after
  5819   tree arg2_type = arg2 ? unlowered_expr_type (arg2) : NULL_TREE;
but then we make arg2 nonnull
  5887   if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR)
  5888     arg2 = integer_zero_node;
while arg2_type is still null and so
  5940   else if (! arg2 || ! CLASS_TYPE_P (arg2_type))
crashes.  Fixed by setting arg2_type in the ++/-- case.

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2019-09-19  Marek Polacek  <pola...@redhat.com>

        PR c++/91819 - ICE with operator++ and enum.
        * call.c (build_new_op_1): Set arg2_type.

        * g++.dg/other/operator4.C: New test.

OK, thanks.

Jason

Reply via email to