Commit 62ee27a4 by Thomas Koenig

re PR fortran/34549 (cshifting by a real value)

2007-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/34549
	* check.c (gfc_check_cshift):  Add check that shift is
	type INTEGER.

2007-12-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/34549
	* cshift_shift_real_1.f90:  New test.

From-SVN: r131136
parent a507baad
2007-12-22 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/34549
* check.c (gfc_check_cshift): Add check that shift is
type INTEGER.
2007-12-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34540
......
......@@ -853,6 +853,9 @@ gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
if (array_check (array, 0) == FAILURE)
return FAILURE;
if (type_check (shift, 1, BT_INTEGER) == FAILURE)
return FAILURE;
if (array->rank == 1)
{
if (scalar_check (shift, 1) == FAILURE)
......
2007-12-22 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/34549
* cshift_shift_real_1.f90: New test.
2007-12-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34540
! { dg-do compile }
! PR 34549 - a real value was accepted for shift.
program main
implicit none
real, dimension(2,2) :: r
data r /1.0, 2.0, 3.0, 4.0/
print *,cshift(r,shift=2.3,dim=1) ! { dg-error "must be INTEGER" }
end program main
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