https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104130

Andre Vehreschild <vehre at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vehre at gcc dot gnu.org

--- Comment #7 from Andre Vehreschild <vehre at gcc dot gnu.org> ---
ifort/ifx (2024.1.2) accepts the code.

My fortran is not very good, but I would expect either a select around the call
to `s` or needing `x` to be of `class(*)`. The latter is what the changed
example errors with:

program p
   class(*), pointer :: z(:,:)
   call s(z)
   call s(transpose(z))
contains
   subroutine s(x) bind(c)
      integer, contiguous :: x(:,:)
   end
end

pr104130.f90:3:12:

    3 |    call s(z)
      |            1
Error: Type mismatch in argument 'x' at (1); passed CLASS(*) to INTEGER(4)
pr104130.f90:4:10:

    4 |    call s(transpose(z))
      |          1
Error: Unlimited polymorphic actual argument at (1) is not matched with either
an unlimited polymorphic or assumed type dummy argument

Reply via email to