[Bug fortran/50960] [OOP] vtables not marked as constant
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 2 16:45:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50960
--- Comment #8 from janus at gcc dot gnu.org 2011-11-02 16:44:56 UTC ---
(In reply to comment #6)
> It fails at least on:
>
> FAIL: gfortran.dg/dynamic_dispatch_4.f03 -O0 (test for excess errors)
Here is a reduced test case:
module foo_mod
type foo
contains
procedure, pass(a) :: getit
end type
private :: getit
contains
integer function getit(a)
class(foo) :: a
end function
end module
module bar_mod
use foo_mod
type :: bar
end type
contains
integer function getit(b)
class(bar) :: b
end function
end module
use bar_mod
end
use bar_mod
1
Error: Interface mismatch for procedure-pointer component 'getit' in structure
constructor at (1): Type/rank mismatch in argument 'a'
Apparently the error is due to two routines having the same names. When
resolving the vtab of foo in the main program, the wrong one is used (since the
other is not accessible). However, I don't quite see yet how that is connected
to the FL_PARAMETER change.
More information about the Gcc-bugs
mailing list