This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34805] defined assignment not allowed to vector subscripted array
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Mar 2008 19:22:33 -0000
- Subject: [Bug fortran/34805] defined assignment not allowed to vector subscripted array
- References: <bug-34805-15620@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pault at gcc dot gnu dot org 2008-03-31 19:22 -------
> "If the actual argument is an array section having a vector subscript, the
> dummy argument is not definable and shall not have the INTENT (OUT), INTENT
> (INOUT), VOLATILE, or ASYNCHRONOUS attributes."
>
> gfortran has this check - but it is not triggered for assignment(=) - or it
> happens later than the mismatch.
In spite of the message it is the INTENT(OUT) requirement that is being
applied. Eliminate the vector subscript or put it on the rhs and the testcase
compiles fine.
Note well that, in spite of the error, this occurs for an intrinsic type/
derive type assignment too.
I happen to think that the testcase is OK since the procedure is elemental.
It's interesting that everybody barfs on it, including Lahey....
Cheers
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34805