This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31608] wrong types in array transfer
- 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: 19 Apr 2007 06:44:34 -0000
- Subject: [Bug fortran/31608] wrong types in array transfer
- References: <bug-31608-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from burnus at gcc dot gnu dot org 2007-04-19 07:44 -------
> Nevertheless, the accepts-invalid is also an embarassing problem (unless we
> collectively misunderstand Fortran rules :)
Well, we do.
if (any (Up ("AbCdEfGhIjKlM") .ne. (/"ABCDEFGHIJKLM"/))) stop 'ERROR'
compiles with
- NAG f95 5.1(346)
- g95 -std=f95 -W -Wall -Wextra -pedantic 4.0.3 (g95 0.91!) Feb 23 2007
- ifort -stand f95 -warn all (9.1.040, 10.0.017beta)
- sunf95 -w4 8.3 Build35_2 2006/12/04
And, of cause, it does not have anything to do with Fortran 2003 (The following
would be: up("abcdef") -> function up(string); character(len=1), dimension(:)
:: string).
What we have here is:
7.1.5 Conformability rules for elemental operations
[...]
For all elemental binary operations, the two operands shall be in shape
conformance. In the case where one is a scalar and the other an array, the
scalar is treated as if it were an array of the same shape as the array operand
with every element, if any, of the array equal to the value of the scalar.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31608