This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/77506] stamdard for f2008 does not allow CHARACTER(LEN=*) in array constructor
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Sep 2016 06:01:50 +0000
- Subject: [Bug fortran/77506] stamdard for f2008 does not allow CHARACTER(LEN=*) in array constructor
- Auto-submitted: auto-generated
- References: <bug-77506-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77506
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #1 from kargl at gcc dot gnu.org ---
Index: array.c
===================================================================
--- array.c (revision 239797)
+++ array.c (working copy)
@@ -1089,6 +1089,7 @@ match_array_cons_element (gfc_constructo
@@ -1141,6 +1142,15 @@ gfc_match_array_constructor (gfc_expr **
gfc_restore_last_undo_checkpoint ();
goto cleanup;
}
+
+ if (ts.type == BT_CHARACTER
+ && ts.u.cl && !ts.u.cl->length && !ts.u.cl->length_from_typespec)
+ {
+ gfc_error ("Type-spec at %L cannot contain an asterick for a "
+ "type parameter", &where);
+ gfc_restore_last_undo_checkpoint ();
+ goto cleanup;
+ }
}
}
else if (m == MATCH_ERROR)