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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -2356,6 +2356,7 @@ 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
+     && x != error_mark_node
      && !useless_type_conversion_p (TREE_TYPE (org_x), TREE_TYPE (x)))
    x = fold_convert (TREE_TYPE (org_x), x);

Reply via email to