! { dg-do compile }
|
! { dg-do compile }
|
! Tests the patch for PR28890, in which a reference to a legal reference
|
! Tests the patch for PR28890, in which a reference to a legal reference
|
! to an assumed character length function, passed as a dummy, would
|
! to an assumed character length function, passed as a dummy, would
|
! cause an ICE.
|
! cause an ICE.
|
!
|
!
|
! Contributed by Paul Thomas
|
! Contributed by Paul Thomas
|
!
|
!
|
character(*) function charrext (n) ! { dg-warning "is obsolescent in fortran 95" }
|
character(*) function charrext (n) ! { dg-warning "is obsolescent in fortran 95" }
|
character(26) :: alpha ="abcdefghijklmnopqrstuvwxyz"
|
character(26) :: alpha ="abcdefghijklmnopqrstuvwxyz"
|
charrext = alpha (1:n)
|
charrext = alpha (1:n)
|
end function charrext
|
end function charrext
|
|
|
character(26), external :: charrext
|
character(26), external :: charrext
|
interface
|
interface
|
integer(4) function test(charr, i)
|
integer(4) function test(charr, i)
|
character(*), external :: charr
|
character(*), external :: charr
|
integer :: i
|
integer :: i
|
end function test
|
end function test
|
end interface
|
end interface
|
|
|
do j = 1 , 26
|
do j = 1 , 26
|
m = test (charrext, j)
|
m = test (charrext, j)
|
m = ctest (charrext, 27 - j)
|
m = ctest (charrext, 27 - j)
|
end do
|
end do
|
contains
|
contains
|
integer(4) function ctest(charr, i) ! { dg-warning "is obsolescent in fortran 95" }
|
integer(4) function ctest(charr, i) ! { dg-warning "is obsolescent in fortran 95" }
|
character(*) :: charr
|
character(*) :: charr
|
integer :: i
|
integer :: i
|
print *, charr(i)
|
print *, charr(i)
|
ctest = 1
|
ctest = 1
|
end function ctest
|
end function ctest
|
end
|
end
|
|
|
integer(4) function test(charr, i) ! { dg-warning "is obsolescent in fortran 95" }
|
integer(4) function test(charr, i) ! { dg-warning "is obsolescent in fortran 95" }
|
character(*) :: charr
|
character(*) :: charr
|
integer :: i
|
integer :: i
|
print *, charr(i)
|
print *, charr(i)
|
test = 1
|
test = 1
|
|
|