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: Fri, 02 Jan 2015 21:25:58 +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
--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to janus from comment #3)
> For the commented-out line I get:
>
> call co_reduce(a,x%ppc)
> 1 2
> Fehler: A argument at (1) has type INTEGER(4) but the function passed as
> OPERATOR at (2) returns REAL(4)
>
> (which I guess is diagnosed correctly?)
Thus the test case is invalid. Here is a corrected version:
module m
type t
procedure(f), pointer, nopass :: ppc
contains
procedure, nopass :: tbp => f
end type
contains
pure integer function f(a,b)
integer, intent(in) :: a,b
f = 0
end function
end module
use m
integer :: a
type(t) :: x
! call co_reduce(a,f)
! call co_reduce(a,x%ppc)
call co_reduce(a,x%tbp)
end