re PR fortran/34759 (Assumed size array reference not allowed in SHAPE intrinsic, even though last subscript specified)

2008-01-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34759
        * check.c (gfc_check_shape): Accept array ranges of
        assumed-size arrays.

2008-01-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34759
        * gfortran.dg/assumed_size_refs_4.f90: New.

From-SVN: r131511
This commit is contained in:
Tobias Burnus 2008-01-13 22:28:30 +01:00 committed by Tobias Burnus
parent 08ffbdad7e
commit 86288ff05f
4 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34759
* check.c (gfc_check_shape): Accept array ranges of
assumed-size arrays.
2008-01-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34432

View File

@ -2394,7 +2394,7 @@ gfc_check_shape (gfc_expr *source)
ar = gfc_find_array_ref (source);
if (ar->as && ar->as->type == AS_ASSUMED_SIZE)
if (ar->as && ar->as->type == AS_ASSUMED_SIZE && ar->type == AR_FULL)
{
gfc_error ("'source' argument of 'shape' intrinsic at %L must not be "
"an assumed size array", &source->where);

View File

@ -1,3 +1,8 @@
2008-01-13 Tobias Burnus <burnus@net-b.de>
PR fortran/34759
* gfortran.dg/assumed_size_refs_4.f90: New.
2008-01-13 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/unchecked_convert1.adb.

View File

@ -0,0 +1,15 @@
! { dg-do compile }
!
! PR fortran/34759
! gfortran was before rejecting passing an assumed-size array
! where the last dimension was specified.
!
! Test case provided by Dick Hendickson.
!
subroutine j_assumed_size(A,N)
dimension A(10,11,12,*), k(3), l(3), m(4)
m = shape(A(:,:,:,:N)) ! OK
l = shape(A(:,:,:,3)) ! OK
m = shape(A(:,:,:,:)) ! { dg-error "upper bound of assumed size array" }
m = shape(A) ! { dg-error "must not be an assumed size array" }
end