This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35997] New: Used function interface bug
- From: "drewmccormack at mac dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Apr 2008 10:01:23 -0000
- Subject: [Bug fortran/35997] New: Used function interface bug
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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