This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33997] New: Generic interface: Rejects non-ambiguous interface as ambiguous
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Nov 2007 09:10:48 -0000
- Subject: [Bug fortran/33997] New: Generic interface: Rejects non-ambiguous interface as ambiguous
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Based on the example/report at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/18873113b18cd5e9/
by Rich Townsend.
I think the following subroutines are not ambiguous. One is
(COMPLEX, COMPLEX, procedure)
and the other is
(COMPLEX, procedure [, COMPLEX])
Thus without foo= they are non-ambiguous and as the first "one" has a
non-optional z_2= (and "two" has no "z_2"), changing the order still should not
make it ambiguous.
For the original example, Michael Metcalf believes that it is valid (and he
stated that ifort compiles it).
My example below compiles with openf95, g95 and sunf95 and is rejected by ifort
(!), NAG f95 and gfortran.
If you believe that my example is invalid - or when you have a fix, please
check also the original example (see link above).
module test
implicit none
interface foo
module procedure one, two
end interface foo
contains
subroutine one (z_1, z_2, f_func)
complex, intent(in) :: z_1
complex, intent(in) :: z_2
interface
function f_func () result (f)
complex :: f
end function f_func
end interface
end subroutine one
! works:
! subroutine two (z_1, f_func)
! fails:
subroutine two (z_1, f_func, f_1)
complex, intent(in), optional :: f_1
complex, intent(in) :: z_1
interface
function f_func () result (f)
complex :: f
end function f_func
end interface
end subroutine two
end module
end
--
Summary: Generic interface: Rejects non-ambiguous interface as
ambiguous
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33997