http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49638
Summary: [OOP] length parameter is ignored when overriding type
bound character functions with constant length.
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
module world
implicit none
type::world_1
contains
procedure,nopass::string=>w1_string
end type world_1
type,extends(world_1)::world_2
contains
procedure,nopass::string=>w2_string
end type world_2
contains
function w1_string()
character(6)::w1_string
w1_string=" world"
end function w1_string
function w2_string()
character(7)::w2_string
w2_string=" world2"
end function w2_string
end module world
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 hello
This program compiles and runs fine with gfortran 4.6.1 and gfortran 4.7.
Nevertheless, the length of an array is a type parameter and all type
parameters of an overriding function shall match the overridden type
parameters.