------- Comment #6 from ohl at physik dot uni-wuerzburg dot de  2010-04-01 
11:47 -------
(In reply to comment #5)

> Well, using
>   type omega_procedures
>      procedure(number_particles_out), nopass, pointer :: number_particles_out
> => NULL()
>   end type omega_procedures
> 
> is definitely wrong: You tell that the procedure pointer has the interface of
> itself.

But that's not the problem:

module m
  implicit none
  type t
     procedure(p1_type), nopass, pointer :: p1 => NULL()
     procedure(p2_type), nopass, pointer :: p2 => NULL()
  end type t
contains
  subroutine proc (t1, t2)
    type(t), intent(in) :: t1, t2
    integer, dimension(t1%p1(), t2%p2()) :: table
  end subroutine proc
end module m

produces the same error.

What is invaild about the code is that t1%p1() and t2%p2() are not
initialization expressions.  Everthing works fine, when the tables are
allocatable.

BTW: gfortran produces correct code for the variant when the procedures are not
procedure pointers.  I stumpled over this OCE when rewriting some code.


-- 


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

Reply via email to