public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/42481]  New: generic interface not recognized
@ 2009-12-23 15:22 william dot mitchell at nist dot gov
  2009-12-23 22:32 ` [Bug fortran/42481] " anlauf at gmx dot de
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: william dot mitchell at nist dot gov @ 2009-12-23 15:22 UTC (permalink / raw)
  To: gcc-bugs

! In this program, gfortran fails to identify the generic interface sub for
! sub_int.  The compiler gives this error message:
!
! > gfortran prog.f90
! prog.f90:40.9:
!
! call sub(1)
!          1
! Error: Type mismatch in argument 'x' at (1); passed INTEGER(4) to REAL(4)
!
! However, if the use statements in program prog are switched so that
! use mod2 comes before use mod1, it correctly identifies the generic
! interface and compiles.
!
! This is with the following version of gfortran:
! > gfortran --version
! GNU Fortran (GCC) 4.5.0 20091205 (experimental) [trunk revision 155016]

module mod1
contains
subroutine sub(x)
real x
end subroutine sub
end module mod1

module mod2
use mod1
interface sub
   module procedure sub, sub_int
end interface sub
contains
subroutine sub_int(i)
integer i
end subroutine sub_int
end module mod2

program prog
use mod1
use mod2
call sub(1)
end program prog


-- 
           Summary: generic interface not recognized
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: william dot mitchell at nist dot gov


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42481


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

end of thread, other threads:[~2010-01-14  6:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-23 15:22 [Bug fortran/42481] New: generic interface not recognized william dot mitchell at nist dot gov
2009-12-23 22:32 ` [Bug fortran/42481] " anlauf at gmx dot de
2009-12-23 22:39 ` anlauf at gmx dot de
2010-01-05  9:20 ` burnus at gcc dot gnu dot org
2010-01-13 22:16 ` pault at gcc dot gnu dot org
2010-01-14  6:14 ` pault at gcc dot gnu dot org
2010-01-14  6:19 ` pault 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).