public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18108] New: [gfortran] overloading does not work for functions
@ 2004-10-22  8:46 martin at mpa-garching dot mpg dot de
  2004-10-22  8:47 ` [Bug fortran/18108] " martin at mpa-garching dot mpg dot de
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-10-22  8:46 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2005-08-11 22:27 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22  8:46 [Bug fortran/18108] New: [gfortran] overloading does not work for functions martin at mpa-garching dot mpg dot de
2004-10-22  8:47 ` [Bug fortran/18108] " martin at mpa-garching dot mpg dot de
2004-10-29  8:13 ` c dot lemmen at fz-juelich dot de
2004-11-11 11:44 ` c dot lemmen at fz-juelich dot de
2004-11-12 10:40 ` martin at mpa-garching dot mpg dot de
2004-11-26 13:33 ` martin at mpa-garching dot mpg dot de
2004-11-26 14:40 ` bdavis at gcc dot gnu dot org
2004-11-30 15:21 ` tobi at gcc dot gnu dot org
2004-11-30 15:22 ` tobi at gcc dot gnu dot org
2005-01-11  0:17 ` steven at gcc dot gnu dot org
2005-05-05 16:40 ` pinskia at gcc dot gnu dot org
2005-06-08  8:57 ` c dot lemmen at fz-juelich dot de
2005-06-08  9:02 ` martin at mpa-garching dot mpg dot de
2005-06-08 10:20 ` c dot lemmen at fz-juelich dot de
2005-06-08 11:28 ` c dot lemmen at fz-juelich dot de
2005-06-09 10:16 ` martin at mpa-garching dot mpg dot de
2005-06-13 14:13 ` david dot c dot gregory at gmail dot com
2005-07-07 22:38 ` steven at gcc dot gnu dot org
2005-07-15 20:40 ` tkoenig at gcc dot gnu dot org
2005-08-02  7:54 ` paulthomas2 at wanadoo dot fr
2005-08-02 10:14 ` c dot lemmen at fz-juelich dot de
2005-08-02 10:24 ` steven at gcc dot gnu dot org
2005-08-11 22:27 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).