This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/63552] [OOP] Type-bound procedures rejected as actual argument to dummy procedure
- 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: Sat, 03 Jan 2015 00:03:46 +0000
- Subject: [Bug fortran/63552] [OOP] Type-bound procedures rejected as actual argument to dummy procedure
- Auto-submitted: auto-generated
- References: <bug-63552-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63552
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
--- Comment #5 from janus at gcc dot gnu.org ---
(In reply to janus from comment #3)
> This draft patch gets rid of the error and regtests cleanly:
Unfortunately this patch is far from complete. What needs to be done is to use
the PPC component of the vtab in the actual-argument expression.
There are two cases to be handled: Polymorphic and non-polymorphic variables.
Here is a test case without CO_REDUCE, which covers both cases:
module m
type t
contains
procedure, nopass :: tbp => f
end type
contains
pure integer function f(a,b)
integer, intent(in) :: a,b
f = a+b
end function
end module
use m
integer :: a
class(t), allocatable :: x
type(t) :: y
call sub(x%tbp)
call sub(y%tbp)
contains
subroutine sub(arg)
procedure(f) :: arg
print *,f(1,2)
end subroutine
end
I'm working on a patch.