https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71576
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- s/properly/. Anyway, the thing is that we use cp_lvalue_kind lvalue = real_lvalue_p (expr); and test the various clk_* bits from it, but this returns clk_none if lvalue_kind has clk_class or clk_rvalueref set in it. In this case, lvalue_kind (expr) is clk_bitfield | clk_class, and if we don't want to ICE, for the creation of the temporary we need the bitfield type to be widened to the underlying type. So perhaps: if (lvalue & clk_bitfield) { expr = convert_bitfield_to_declared_type (expr); expr = fold_convert (type, expr); } should be if (lvalue_kind (expr) & clk_bitfield) instead, or just unconditional? What about the other lvalue & clk_* tests a few lines before? Do they mean to ignore clk_bitfield or clk_packed if clk_class (or clk_rvalueref) is also set? If not, perhaps real_lvalue_p call should be replaced with lvalue_kind.