This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/18108] New: [gfortran] overloading does not work for functions
- From: "martin at mpa-garching dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2004 08:46:42 -0000
- Subject: [Bug fortran/18108] New: [gfortran] overloading does not work for functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The current gfortran rejects the following code:
module foo
implicit none
interface bar
module procedure bar1, bar2
end interface
contains
function bar1 (arg)
integer arg
logical bar1
bar1 = (arg==0)
end function
function bar2 (arg)
real arg
logical bar2
bar2 = (arg==0)
end function
subroutine baz
logical l
l = bar (3)
end subroutine
end module foo
~/tmp>gfortran -v gfbug.f90
Driving: gfortran -v gfbug.f90 -lgfortranbegin -lgfortran -lm -shared-libgcc
Reading specs from /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: /scratch/gcc/configure --quiet
--prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,f95
--with-gmp=/afs/mpa/data/martin/mygmp
Thread model: posix
gcc version 4.0.0 20041021 (experimental)
/afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.0.0/f951 gfbug.f90
-quiet -dumpbase gfbug.f90 -mtune=pentiumpro -auxbase gfbug -version -o
/tmp/ccTKCcxy.s
GNU F95 version 4.0.0 20041021 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 4.0.0 20041021 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
In file gfbug.f90:27
l = bar (3)
1
Error: Symbol 'bar' at (1) has no IMPLICIT type
In principle gfortran should be able to choose the correct variant of "bar"
with the information it has. All other compilers I tried (ifc, NAG, xlf95)
accept this code.
--
Summary: [gfortran] overloading does not work for functions
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: martin at mpa-garching dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18108