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



--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-01-10 
22:35:06 UTC ---

Shorter test case for gfortran.dg/typebound_operator_*:



module i_field_module

  implicit none

  type :: i_field

    integer :: i

  end type

contains

  function i_plus_i(lhs)

    class(i_field) ,intent(in)  :: lhs

    class(i_field) ,allocatable :: i_plus_i

    allocate (i_plus_i, source = i_field (0))

  end function

  function i_multiply_real(lhs)

    class(i_field) ,intent(in)  :: lhs

    class(i_field) ,allocatable :: i_multiply_real

    allocate (i_multiply_real, source = i_field (0))

  end function

end module



Note that if the 'class's are replaced with 'type's, the program compiles.

Reply via email to