Is the following patch OK (regtested on x86_64-apple-darwin15)? Should it be back ported to the gcc-5 branch?
TIA Dominique Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (revision 234788) +++ gcc/fortran/ChangeLog (working copy) @@ -1,3 +1,10 @@ +2016-04-06 Tobias Burnus <[email protected]> + Dominique d'Humieres <[email protected]> + + PR fortran/47040 + * array.c (gfc_match_array_constructor): add "without type-spec" + to the error message. + 2016-04-04 Andre Vehreschild <[email protected]> PR fortran/67538 Index: gcc/fortran/array.c =================================================================== --- gcc/fortran/array.c (revision 234788) +++ gcc/fortran/array.c (working copy) @@ -1136,7 +1136,8 @@ goto done; else { - gfc_error ("Empty array constructor at %C is not allowed"); + gfc_error ("Empty array constructor without type-spec at %C " + "is not allowed"); goto cleanup; } } Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (revision 234788) +++ gcc/testsuite/ChangeLog (working copy) @@ -1,3 +1,7 @@ +2016-04-06 Dominique d'Humieres <[email protected]> + + * gfortran.dg/empty_constructor.f90: New test. + 2016-04-06 Eric Botcazou <[email protected]> * gcc.c-torture/execute/20101011-1.c (__VISIUM__): Set DO_TEST to 0. Index: gcc/testsuite/gfortran.dg/empty_constructor.f90 =================================================================== --- gcc/testsuite/gfortran.dg/empty_constructor.f90 (nonexistent) +++ gcc/testsuite/gfortran.dg/empty_constructor.f90 (working copy) @@ -0,0 +1,17 @@ +! { dg-do compile } +! PR 47040 +! Contributed by Tobias Burnus <[email protected]> +! +program test_print + implicit none + integer :: i + call print( [ ] ) ! { dg-error "Empty array constructor without type-spec" } + call print( [integer :: ] ) + call print( pack( [ 1 ], [ 2 ] == 3 ) ) + call print( [ ( i, i = 1, 0 ) ] ) +contains + subroutine print( array ) + integer, dimension(:) :: array + write(*,*) size(array) + end subroutine print +end program test_print
