This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49630] [OOP] ICE on obsolescent deferred-length type bound character function
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 4 Jul 2011 20:22:26 +0000
- Subject: [Bug fortran/49630] [OOP] ICE on obsolescent deferred-length type bound character function
- Auto-submitted: auto-generated
- References: <bug-49630-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49630
--- Comment #3 from janus at gcc dot gnu.org 2011-07-04 20:21:55 UTC ---
Here is a related deferred-length example:
module abc
implicit none
type::abc_type
contains
procedure::abc_function
end type abc_type
contains
function abc_function(this)
class(abc_type),intent(in)::this
character(:),allocatable::abc_function
allocate(abc_function,source="hello")
end function abc_function
subroutine do_something(this)
class(abc_type),intent(in)::this
print *,this%abc_function()
end subroutine do_something
end module abc
use abc
type(abc_type) :: a
call do_something(a)
end
This currently ICEs, but when changing the type-bound call in the "print" line
to a plain function call, i.e. "abc_function(this)", then it is accepted and
gives the expected output.