Commit 38acc41d by Steve Kargl Committed by Thomas König

PR 91800 - reject Hollerith constants as type initializer.

2020-04-20  Steve Kargl  <kargl@gcc.gnu.org>
	Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/91800
	* decl.c (variable_decl): Reject Hollerith constants as type
	initializer.

2020-04-20  Steve Kargl  <kargl@gcc.gnu.org>
	Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/91800
	* gfortran.dg/hollerith_9.f90: New test.
parent 85d8c05a
2020-04-20 Steve Kargl <kargl@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/91800
* decl.c (variable_decl): Reject Hollerith constants as type
initializer.
2020-04-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/93500
......
......@@ -2904,6 +2904,15 @@ variable_decl (int elem)
}
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;
}
if (gfc_current_state () == COMP_DERIVED
&& gfc_current_block ()->attr.pdt_template)
{
gfc_symbol *param;
......
2020-04-20 Steve Kargl <kargl@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/91800
* gfortran.dg/hollerith_9.f90: New test.
2020-04-19 David Edelsohn <dje.gcc@gmail.com>
* g++.dg/debug/dwarf2/pr85550.C: Skip AIX.
......
! { dg-do compile }
! PR 91800 - this used to cause an ICE.
module m
type t(n) ! { dg-error "does not have a component corresponding to parameter" }
integer, len :: n = 4habcd ! { dg-error "Initialization of structure component with a HOLLERITH constant" }
end type
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment