[Bug fortran/51652] Allocate with type-spec and source-expr: check whether length type-parameter is the same is lacking
dominiq at lps dot ens.fr
gcc-bugzilla@gcc.gnu.org
Fri Nov 18 14:19:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51652
--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
AFAICT this PR is mostly fixed since gcc-5. However I see a remaining glitch
with the following variant of the original test
module settings
type keyword
! character(60), allocatable :: c(:) ! works but should it?
! character(80), allocatable :: c(:) ! works
character(:), allocatable :: c(:)
end type keyword
type(keyword) :: kw(10)
contains
subroutine save_kw
!allocate(kw(1)%c(10))
allocate(character(80) :: kw(1)%c(10))
kw(1)%c(1) = 'abcd'
print *, "'", kw(1)%c(1), "'"
if (trim(kw(1)%c(1)).eq.'abcd') then ! problem here
print *, 'yes'
else
print *, 'no'
endif
end subroutine save_kw
end module settings
!*************************************************************************
program ice
use settings
call save_kw
end program ice
which prints
'abcd
'
yes
at run time, i.e., the second quote is missing.
More information about the Gcc-bugs
mailing list