This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34231] New: wrong selection of a routine belonging to an interface
- From: "francois dot jacq at irsn dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Nov 2007 22:53:40 -0000
- Subject: [Bug fortran/34231] New: wrong selection of a routine belonging to an interface
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following test program calls the wrong routine :
[lcoul@b04p0004 test]$ gfortran test3.f90
[lcoul@b04p0004 test]$ a.out
odfamilycnames
With ifort (or g95, lf95, SUN f90) the result is :
[lcoul@b04p0004 test]$ ifort test3.f90
[lcoul@b04p0004 test]$ a.out
odfamilycname
File test3.f90 :
MODULE test
TYPE odbase ; INTEGER :: value ; END TYPE
INTERFACE odfname
MODULE PROCEDURE odfamilycname,odfamilycnames
END INTERFACE
CONTAINS
SUBROUTINE odfamilycnames(base,nfam,cnames)
TYPE(odbase),INTENT(in) :: base
INTEGER ,INTENT(out) :: nfam
CHARACTER(*),INTENT(out) :: cnames(*)
nfam=0
cnames(1:nfam)=' '
write(*,*) 'odfamilycnames'
END SUBROUTINE
SUBROUTINE odfamilycname(base,pos,cname)
TYPE(odbase),INTENT(in) :: base
INTEGER ,INTENT(in) :: pos
CHARACTER(*),INTENT(out) :: cname
cname=' '
write(*,*) 'odfamilycname'
END SUBROUTINE
END MODULE
PROGRAM main
USE test
TYPE(odbase) :: base
INTEGER :: i=1
CHARACTER(8) :: cname
CALL odfname(base,i,cname)
END PROGRAM
--
Summary: wrong selection of a routine belonging to an interface
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: francois dot jacq at irsn dot fr
GCC build triplet: [trunk revision 130366]
GCC host triplet: GNU Fortran (GCC) 4.3.0
GCC target triplet: 20071123 (experimental)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34231