This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/34231] New: wrong selection of a routine belonging to an interface


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]