This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33233] New: Parent and contained procedure: Wrongly treated as generic procedures
- 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: 29 Aug 2007 16:02:33 -0000
- Subject: [Bug fortran/33233] New: Parent and contained procedure: Wrongly treated as generic procedures
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This is a follow up to PR30746.
While I believe the test case in PR30746 is correct, I think the
gfortran.dg/host_assoc_function_1.f90 test case is wrong.
(Simplified, see testsuite for the full file)
MODULE m
REAL :: x(3) = (/ 1.5, 2.5, 3.5 /)
CONTAINS
SUBROUTINE s
if (x(2) .ne. 2.5) call abort ()
CONTAINS
FUNCTION x(n, m)
x = REAL(n)**m
END FUNCTION
END SUBROUTINE s
END MODULE m
I am very much in favour of the other compilers which think the "x" in "s"
refers to only the contained function "x" and not to the variable. gfortran
somehow seems to treat the symbol "x" as generic symbol which means with one
argument the variable and with two the function.
I would argue that the function name makes the variable inaccessible.
Using NAG's f95:
Error: host_assoc_function_1.f90, line 22: Too few arguments in reference to X
Error: host_assoc_function_1.f90, line 23: Too few arguments in reference to Z
ifort:
fortcom: Error: host_assoc_function_1.f90, line 22: A non-optional actual
argument must be present when invoking a procedure with an explicit interface.
[M] [...]
--
Summary: Parent and contained procedure: Wrongly treated as
generic procedures
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: accepts-invalid
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=33233