[Bug fortran/60255] Deferred character length variable at (1) cannot yet be associated with unlimited polymorphic entities
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 18 14:20:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60255
--- Comment #3 from janus at gcc dot gnu.org ---
Consider the following simple test case:
implicit none
call sub1("test")
call sub2()
contains
subroutine sub1(dcl) ! accepted
character(len=*), target :: dcl
class(*), pointer :: ucp
ucp => dcl
select type (ucp)
type is (character(len=*))
print *,"char"
type is (real)
print *,"real"
class default
print *,"something else"
end select
end subroutine
subroutine sub2 ! rejected
character(len=:), allocatable, target :: dcl
class(*), pointer :: ucp
dcl = "ttt"
ucp => dcl
select type (ucp)
type is (character(len=*))
print *,"char"
type is (real)
print *,"real"
class default
print *,"something else"
end select
end subroutine
end
While 'sub1' is currently accepted (with unpatched trunk) and shows the right
runtime behavior, 'sub2' is rejected with the error of comment 0.
With the patch in comment 2, both cases are accepted and show the right runtime
behavior.
The only potential problem I can see is that the '_size' component of the vtab
is zero and does not reflect its actual size.
More information about the Gcc-bugs
mailing list