This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/49638] [OOP] length parameter is ignored when overriding type bound character functions with constant length.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]