[Bug fortran/16946] New: sum (array, mask) is not accepted
schnetter at aei dot mpg dot de
gcc-bugzilla@gcc.gnu.org
Mon Aug 9 16:59:00 GMT 2004
It seems that gfortran does not accept the expression
sum (array, mask)
The code
program sum_mask
implicit none
logical :: equal(3)
integer :: itype
integer :: n
itype = sum((/(2**n, n=0, 2)/), equal)
end program sum_mask
is rejected with the error message
$ ~/gcc/bin/gfortran -c sum_mask.f90
In file sum_mask.f90:6
itype = sum((/(2**n, n=0, 2)/), equal)
1
Error: Array index at (1) must be of INTEGER type
According to my draft of Fortran 95, section 13.14.105, this should be legal.
In my draft of Fortran 2k, section 13.5.12, this should also be legal.
--
Summary: sum (array, mask) is not accepted
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schnetter at aei dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16946
More information about the Gcc-bugs
mailing list