This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49638] [OOP] length parameter is ignored when overriding type bound character functions with constant length.
- 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: Wed, 3 Aug 2011 18:37:32 +0000
- Subject: [Bug fortran/49638] [OOP] length parameter is ignored when overriding type bound character functions with constant length.
- Auto-submitted: auto-generated
- References: <bug-49638-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49638
--- Comment #4 from janus at gcc dot gnu.org 2011-08-03 18:36:55 UTC ---
(In reply to comment #3)
> A check for different ranks can be added like this:
This will reject the following variant of the original test case, which is
accepted up to now:
module world
implicit none
type :: world_1
contains
procedure, nopass :: string => w1_string
end type
type, extends(world_1)::world_2
contains
procedure, nopass :: string => w2_string
end type
contains
function w1_string()
integer :: w1_string
w1_string = 1
end function
function w2_string()
integer,dimension(2) ::w2_string
w2_string = 2
end function
end module
program hello
use world
implicit none
type(world_1)::w1
type(world_2)::w2
print *,"hello world: hello",w1%string()
print *,"hello world2: hello",w2%string()
end program