------- Comment #1 from burnus at gcc dot gnu dot org  2009-12-17 23:02 -------
The following program is also rejected, unless the marked line is
removed/comment out. At a glance, it looks OK - and ifort, NAG f95 and g95
accept it. The error message is:


   print *, fun(enisoc, [0.0])
                1
Error: ELEMENTAL non-INTRINSIC procedure 'enisoc' is not allowed as an actual
argument at (1)


 module cos_mod
   implicit none
   interface enisoc
      module procedure element, enisoc
   end interface enisoc
   contains
      pure function enisoc(x)
         real, intent(in) :: x(:)
         real enisoc(size(x))

         enisoc = 2
      end function enisoc

      elemental function element(x)
         real, intent(in) :: x
         real element

         element = cos(x)
      end function element
end module cos_mod

program main
   use cos_mod
   implicit none
   interface
      function fun(f,x)
         implicit none
         interface
            pure function f(x)
               real, intent(in) :: x(:)
               real f(size(x))
            end function f
         end interface
         real x(:)
         real fun(size(x))
      end function fun
   end interface

   print *, enisoc(0.0)  ! <<< Works without this line
   print *, fun(enisoc, [0.0])
end program main

!function fun(f,x)
!   implicit none
!   interface
!      pure function f(x)
!         real, intent(in) :: x(:)
!         real f(size(x))
!      end function f
!   end interface
!   real x(:)
!   real fun(size(f(x)))
!
!   fun = f(x)
!end function fun


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|PROCEDURE: Rejects          |PROCEDURE: Rejects interface
                   |interfface which is both    |which is both specific and
                   |specific and generic        |generic procedure
                   |procedure                   |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42418

Reply via email to