This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49630] New: [OOP] ICE on obsolescent assumed length deferred type bound character function
- From: "boschmann at tp1 dot physik.uni-siegen.de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 4 Jul 2011 15:31:55 +0000
- Subject: [Bug fortran/49630] New: [OOP] ICE on obsolescent assumed length deferred type bound character function
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49630
Summary: [OOP] ICE on obsolescent assumed length deferred type
bound character function
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: boschmann@tp1.physik.uni-siegen.de
CC: janus@gcc.gnu.org
Here is one more weird piece of code:
module abc
implicit none
type,abstract::abc_abstract
contains
procedure(abc_interface),deferred::abc_function
end type abc_abstract
type,extends(abc_abstract)::abc_type
contains
procedure::abc_function
end type abc_type
abstract interface
function abc_interface(this)
import abc_abstract
class(abc_abstract),intent(in)::this
character(len=*)::abc_interface !obsolescent feature
end function abc_interface
end interface
contains
function abc_function(this)
class(abc_type),intent(in)::this
character(len=5)::abc_function
abc_function="hello"
end function abc_function
subroutine do_something(this)
class(abc_abstract),intent(in)::this
print *,this%abc_function()
end subroutine do_something
end module abc
gcc 4.7 terminates with a segmentation fault. I get an ICE error message on my
full program, but it turned to a segfault in this reduced module.
Anyway this code doesn't look right, so I have tried some workarounds like
allocatable characters. But those ended up in different compiler errors.
So what is the state of allocatable character functions? Are they supposed to
work?