Commit 54b96a2d by Steven G. Kargl

re PR fortran/68108 (erroneous error message 'scalar integer expression expected')

2015-10-27  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/68108
	* decl.c (char_len_param_value): Check for REF_ARRAY.
 
2015-10-27  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/68108
	* gfortran.dg/pr67805_2.f90: New test.

From-SVN: r229446
parent 5affe17f
2015-10-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/68108
* decl.c (char_len_param_value): Check for REF_ARRAY.
2015-10-26 Louis Krupp <louis.krupp@zoho.com>
PR fortran/66056
......
......@@ -748,13 +748,15 @@ char_len_param_value (gfc_expr **expr, bool *deferred)
/* This catches the invalid code "[character(m(2:3)) :: 'x', 'y']",
which causes an ICE if gfc_reduce_init_expr() is called. */
if (e->ref && e->ref->u.ar.type == AR_UNKNOWN
if (e->ref && e->ref->type == REF_ARRAY
&& e->ref->u.ar.type == AR_UNKNOWN
&& e->ref->u.ar.dimen_type[0] == DIMEN_RANGE)
goto syntax;
gfc_reduce_init_expr (e);
if ((e->ref && e->ref->u.ar.type != AR_ELEMENT)
if ((e->ref && e->ref->type == REF_ARRAY
&& e->ref->u.ar.type != AR_ELEMENT)
|| (!e->ref && e->expr_type == EXPR_ARRAY))
{
gfc_free_expr (e);
......
2015-10-27 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/68108
* gfortran.dg/pr67805_2.f90: New test.
2015-10-27 Abderrazek Zaafrani <a.zaafrani@samsung.com>
Aditya Kumar <aditya.k7@samsung.com>
......
! { dg-do compile }
! PR fortran/68108
! Code contributed by Juergen Reuter (juergen.reuter at desy dot de)
! Test fix for regression caused by PR fortran/67805.
module lexers
implicit none
type :: template_t
character(256) :: charset1
integer :: len1
end type template_t
contains
subroutine match_quoted (tt, s, n)
type(template_t), intent(in) :: tt
character(*), intent(in) :: s
integer, intent(out) :: n
character(tt%len1) :: ch1
ch1 = tt%charset1
end subroutine match_quoted
end module lexers
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