public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35997]  New: Used function interface bug
@ 2008-04-21 10:02 drewmccormack at mac dot com
  2008-04-22  1:20 ` [Bug fortran/35997] [4.3/4.4 regression]Used " jvdelisle at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: drewmccormack at mac dot com @ 2008-04-21 10:02 UTC (permalink / raw)
  To: gcc-bugs

Code that has a function interface used from two modules can fail if one of the
modules renames the function interface. The example below fails to compile with
this message:

gfortran testfuncinterface.f90 
testfuncinterface.f90:21.7:

  if ( valid() ) then
      1
Error: IF clause at (1) requires a scalar LOGICAL expression


Source Code:

module funcinterfacemod

  interface
    logical function valid()
    end function
  end interface

end module

module secondmod
  use funcinterfacemod, valid2 => valid
end module

logical function valid()
  valid = .true.
end function

program main
  use secondmod
  use funcinterfacemod
  if ( valid() ) then
    print *,'Is Valid'
  endif
end program


This example does compile is the order of the use statements is reversed. This
also compiles on earlier versions of gfortran (eg 4.3.0 20071114 (experimental)
(GCC))


-- 
           Summary: Used function interface bug
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drewmccormack at mac dot com
 GCC build triplet: 4.3.0 20080125 (experimental) (GCC)
  GCC host triplet: i386-apple-darwin8.11.1
GCC target triplet: i386-apple-darwin8.11.1


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


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

end of thread, other threads:[~2008-05-13 20:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-21 10:02 [Bug fortran/35997] New: Used function interface bug drewmccormack at mac dot com
2008-04-22  1:20 ` [Bug fortran/35997] [4.3/4.4 regression]Used " jvdelisle at gcc dot gnu dot org
2008-04-28 11:55 ` pault at gcc dot gnu dot org
2008-04-30 20:15 ` pault at gcc dot gnu dot org
2008-05-05  5:30 ` [Bug fortran/35997] [4.3/4.4 regression] Used " pinskia at gcc dot gnu dot org
2008-05-05 15:48 ` jsm28 at gcc dot gnu dot org
2008-05-05 17:06 ` burnus at gcc dot gnu dot org
2008-05-13 20:28 ` pault at gcc dot gnu dot org
2008-05-13 20:29 ` 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).