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/63552] [OOP] Type-bound procedures rejected as actual argument to dummy procedure


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


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