This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44960] New: non-array used as an array, identified as an external function
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2010 21:57:19 -0000
- Subject: [Bug fortran/44960] New: non-array used as an array, identified as an external function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Spin-off from PR43179:
type t
integer :: a
end type t
type(t) :: foo
! external :: foo ! "Syntax error in PRINT"
print *, foo(1)%a
end
foo is used as an array although no declared as one; gfortran takes it as an
external function, although one can not access components of returned types
directly from the function call as it would be possible in C. The latter is
picked up if foo is confirmed as EXTERNAL function.
Expected: either error-out on component access on function return value or
deduce that it can not be function and must be an array - and error out as it
is not declared as one.
--
Summary: non-array used as an array, identified as an external
function
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dfranke at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44960