------- Comment #9 from fxcoudert at gcc dot gnu dot org 2009-05-16 16:15 ------- Patch posted for the compile-time part of this PR: http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01013.html
Here are three testcases that should be handled when runtime checking is performed: $ cat a3.f90 program main implicit none character(len=10) :: s integer(kind=8) :: i s = 'xxxxxxxxxx' i = 2_8**32_8+3_8 print *, s(1:i) ! runtime error expected print *, s(i:i) ! runtime error expected end program main $ cat a4.f90 program main call foo(2_8**32_8+4_8) contains subroutine foo(i) integer(kind=8), intent(in) :: i character(len=i) :: x print *, len(x) end subroutine foo end program main $ cat a5.f90 program main print *, foo(2_8**32_8+4_8) contains function foo(i) integer(kind=8), intent(in) :: i character(len=i) :: foo foo = "x" end function foo end program main -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31243