===================================================================
@@ -2514,7 +2514,19 @@ gfc_int2log (gfc_expr *src, int kind)
return result;
}
+/* Convert character to character. We only use wide strings internally,
+ so we only set the kind. */
+gfc_expr *
+gfc_character2character (gfc_expr *src, int kind)
+{
+ gfc_expr *result;
+ result = gfc_copy_expr (src);
+ result->ts.kind = kind;
+
+ return result;
+}
+
/* Helper function to set the representation in a Hollerith conversion.
This assumes that the ts.type and ts.kind of the result have already
been set. */
===================================================================
@@ -82,6 +82,7 @@ gfc_expr *gfc_hollerith2real (gfc_expr *, int);
gfc_expr *gfc_hollerith2complex (gfc_expr *, int);
gfc_expr *gfc_hollerith2character (gfc_expr *, int);
gfc_expr *gfc_hollerith2logical (gfc_expr *, int);
+gfc_expr *gfc_character2character (gfc_expr *, int);
#endif /* GFC_ARITH_H */
===================================================================
@@ -7130,6 +7130,13 @@ gfc_convert_constant (gfc_expr *e, bt type, int ki
}
break;
+ case BT_CHARACTER:
+ if (type == BT_CHARACTER)
+ f = gfc_character2character;
+ else
+ goto oops;
+ break;
+
default:
oops:
gfc_internal_error ("gfc_convert_constant(): Unexpected type");