This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/16946] New: sum (array, mask) is not accepted
- From: "schnetter at aei dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2004 16:59:53 -0000
- Subject: [Bug fortran/16946] New: sum (array, mask) is not accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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