[Bug fortran/91800] ICE in gfc_code2string(): Bad code
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 19 00:25:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91800
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #3 from kargl at gcc dot gnu.org ---
Patch is against svn r280157.
Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c (revision 280157)
+++ gcc/fortran/decl.c (working copy)
@@ -2879,6 +2880,15 @@ variable_decl (int elem)
{
gfc_error ("Initialization of allocatable component at %C is not "
"allowed");
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+
+ if (gfc_current_state () == COMP_DERIVED
+ && initializer && initializer->ts.type == BT_HOLLERITH)
+ {
+ gfc_error ("Initialization of structure component with a HOLLERITH "
+ "constant at %L is not allowed", &initializer->where);
m = MATCH_ERROR;
goto cleanup;
}
More information about the Gcc-bugs
mailing list