------- Comment #2 from janus at gcc dot gnu dot org  2008-11-27 22:50 -------
I also tried to compile the other procptr examples from the WikiBooks page,
which is linked in comment #0.

The only remaining problem I found was:

program bsp
  implicit none   

  abstract interface
    subroutine up()
    end subroutine up
  end interface

  procedure( up ) , pointer :: pptr

  pptr => add  

  contains

    function add( a, b )
      integer               :: add
      integer, intent( in ) :: a, b
      add = a + b
    end function add

end program bsp

This is currently accepted by gfortran, although invalid, and is rejected e.g.
by ifort with

error #8179: The procedure pointer and the procedure target must both be
functions or subroutines.

Inserting a statement like

  print *, pptr()

produces an ICE.


-- 


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

Reply via email to