https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81607
--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I'm actually testing this --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -2314,9 +2314,9 @@ cp_fold (tree x) /* A COND_EXPR might have incompatible types in branches if one or both arms are bitfields. If folding exposed such a branch, fix it up. */ - if (TREE_CODE (x) != code) - if (tree type = is_bitfield_expr_with_lowered_type (x)) - x = fold_convert (type, x); + if (TREE_CODE (x) != code + && !useless_type_conversion_p (TREE_TYPE (org_x), TREE_TYPE (x))) + x = fold_convert (TREE_TYPE (org_x), x); break; so I hope that case is covered. We'll see.