re PR fortran/41800 ([OOP] ICE in fold_convert_loc, at fold-const.c:2789)
[platform/upstream/gcc.git] / gcc / fortran / trans-expr.c
index dc58dbf..da442ed 100644 (file)
@@ -4660,7 +4660,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
          gfc_add_expr_to_block (&block, tmp);
        }
     }
-  else if (ts.type == BT_DERIVED)
+  else if (ts.type == BT_DERIVED || ts.type == BT_CLASS)
     {
       gfc_add_block_to_block (&block, &lse->pre);
       gfc_add_block_to_block (&block, &rse->pre);