[Bug fortran/63552] [OOP] Type-bound procedures rejected as actual argument to dummy procedure
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jan 2 21:26:00 GMT 2015
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
More information about the Gcc-bugs
mailing list