Commit e81e83d0 by Steven G. Kargl

re PR fortran/77506 (F2008 Standard does not allow CHARACTER(LEN=*) in array constructor)

2016-09-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77506
	* array.c (gfc_match_array_constructor): CHARACTER(len=*) cannot
	appear in an array constructor.

2016-09-09  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77506
	* gfortran.dg/pr77506.f90: New test.

From-SVN: r240052
parent 36d9b716
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77506
* array.c (gfc_match_array_constructor): CHARACTER(len=*) cannot
appear in an array constructor.
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77507
* intrinsic.c (add_functions): Use correct keyword.
......
......@@ -1142,6 +1142,15 @@ gfc_match_array_constructor (gfc_expr **result)
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 asterisk for a "
"type parameter", &where);
gfc_restore_last_undo_checkpoint ();
goto cleanup;
}
}
}
else if (m == MATCH_ERROR)
......
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77506
* gfortran.dg/pr77506.f90: New test.
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77507
* gfortran.dg/pr77507.f90: New test.
......
! { dg-do compile }
program foo
print *, [character(len=*)::'ab','cd'] ! { dg-error "contain an asterisk" }
end program foo
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