aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index da6ad17..40cd76e 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -1762,6 +1762,13 @@ resolve_tag_format (gfc_expr *e)
It may be assigned an Hollerith constant. */
if (e->ts.type != BT_CHARACTER)
{
+ if (e->ts.type == BT_DERIVED || e->ts.type == BT_CLASS
+ || e->ts.type == BT_VOID)
+ {
+ gfc_error ("Non-character non-Hollerith in FORMAT tag at %L",
+ &e->where);
+ return false;
+ }
if (!gfc_notify_std (GFC_STD_LEGACY, "Non-character in FORMAT tag "
"at %L", &e->where))
return false;