Commit 0735a1c8 by Steven G. Kargl

re PR fortran/80752 (ICE with wrong type initialization)

2017-05-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/80752
	* expr.c (gfc_generate_initializer):  If type conversion fails,
	check for error and return NULL.

2017-05-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/80752
	gfortran.dg/pr80752.f90: New test.

From-SVN: r248072
parent 900b5b6a
2017-05-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/80752
* expr.c (gfc_generate_initializer): If type conversion fails,
check for error and return NULL.
2017-05-14 Nicolas Koenig <koenigni@student.ethz.ch>
PR fortran/80442
......
......@@ -4395,7 +4395,12 @@ gfc_generate_initializer (gfc_typespec *ts, bool generate)
if ((comp->ts.type != tmp->ts.type
|| comp->ts.kind != tmp->ts.kind)
&& !comp->attr.pointer && !comp->attr.proc_pointer)
gfc_convert_type_warn (ctor->expr, &comp->ts, 2, false);
{
bool val;
val = gfc_convert_type_warn (ctor->expr, &comp->ts, 1, false);
if (val == false)
return NULL;
}
}
if (comp->attr.allocatable
......
2017-05-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/80752
gfortran.dg/pr80752.f90: New test.
2017-05-15 Uros Bizjak <ubizjak@gmail.com>
PR target/80425
......
! { dg-do compile }
! PR fortran/80752
module exchange_utils
implicit none
integer, parameter, public :: knd = 8
type, private :: a
logical :: add_vs98 = 0.0_knd ! { dg-error "Can't convert" }
end type a
type, private :: x_param_t
type(a) :: m05_m06
end type x_param_t
type(x_param_t), public, save :: x_param
end module exchange_utils
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