[Bug fortran/16940] New: implicit none over-riding module declaration
paulthomas2 at wanadoo dot fr
gcc-bugzilla@gcc.gnu.org
Mon Aug 9 14:31:00 GMT 2004
! note Max_Loc_Mod MUST be separated in bug6mod.f90 - another bug?
!
! The "implicit none" on line 20 causes (compiles and runs OK if deleted):
!
! $ ../bin/gfortran bug6mod.f90 bug6.f90 -o test
! In file bug6.f90:9
!
! N = Max_Loc (Unsorted) ! Location of largest element
! 1
! Error: Symbol 'max_loc' at (1) has no IMPLICIT type
! In file bug6.f90:14
!
! use Sel_Sort_Mod
! 1
! Fatal Error: Can't open module file 'sel_sort_mod.mod' for reading at (1): No su
! ch file or directory
module Sel_Sort_Mod
use Max_Loc_Mod
implicit none
contains
recursive subroutine Selection_Sort (Unsorted)
real, intent (in out) :: Unsorted (:)
integer :: N
N = Max_Loc (Unsorted) ! Location of largest element
return
end subroutine Selection_Sort
end module Sel_Sort_Mod
program Variety
use Sel_Sort_Mod
implicit none
real :: Vector (2)
Vector = (/1.0,2.0/)
call Selection_Sort (Vector)
stop
end program Variety
!bug6mod.f90 *********
module Max_Loc_Mod
implicit none
interface Max_Loc
module procedure I_Max_Loc, R_Max_Loc
end interface
contains
function I_Max_Loc (Vector) result(Ans)
integer, intent (in), dimension(:) :: Vector
integer :: Ans
Ans = size(Vector)
return
end function I_Max_Loc
function R_Max_Loc (Vector) result(Ans)
real, intent (in), dimension(:) :: Vector
integer :: Ans
Ans = size(Vector)
return
end function R_Max_Loc
end module Max_Loc_Mod
--
Summary: implicit none over-riding module declaration
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paulthomas2 at wanadoo dot fr
CC: bdavis at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16940
More information about the Gcc-bugs
mailing list