[Bug fortran/17379] Generic functions not resolved

matthew dot amos at baesystems dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 27 10:49:00 GMT 2004


------- Additional Comments From matthew dot amos at baesystems dot com  2004-09-27 10:49 -------
I have some code which triggers the same bug (I think). If it helps, I have
reproduced the code here. The funny thing is; it works if you replace "length"
with "length_R4" in normalise_R4.

module module_vec3d

  implicit none

! Public procedures
  private
  public :: normalise, length

! Module constants
  integer, parameter :: SP = selected_real_kind(6)
  integer, parameter :: DP = selected_real_kind(12)

! Vector length
  INTERFACE length
     MODULE PROCEDURE length_R4
  END INTERFACE

! Vector normalise
  INTERFACE normalise
     MODULE PROCEDURE normalise_R4
  END INTERFACE

CONTAINS

  FUNCTION length_R4 (x) result (y)
    real(SP) :: y
    real(SP), intent(in) :: x(3)
    y = sqrt(x(1)**2 + x(2)**2 + x(3)**2)
  END FUNCTION length_R4

  FUNCTION normalise_R4 (x) result (y)
    real(SP) :: y(3)
    real(SP), intent(in) :: x(3)
    y = x / length(x)
  END FUNCTION normalise_R4

END MODULE module_vec3d


-- 


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



More information about the Gcc-bugs mailing list