This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/15963] New: Error when using count in initialization expression
- From: "Mart dot Rentmeester at nn-online dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jun 2004 14:55:43 -0000
- Subject: [Bug fortran/15963] New: Error when using count in initialization expression
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code generates a compiler error.
It happens only when a and b are of non-numerical type;
and only in an initialization expression.
When array b wouldn't be used and only
write(6,*) count(a < 'D')
was used the compiler accepts it.
troogle> gfortran -c -v n11.f95
Reading specs from /OPT/32/gcc-2004-06-09/lib/gcc/hppa2.0w-hp-hpux11.11/3.5.
0/specs
Configured with: ../configure --enable-languages=c,f95
--prefix=/opt32/gcc-2004-06-09 --with-gmp=/opt32/gmp --with-gnu-as
--with-as=/opt32/binutils/bin/as --enable-threads --disable-shared --disable-nls
Thread model: posix
gcc version 3.5.0 20040611 (experimental)
/OPT/32/gcc-2004-06-09/libexec/gcc/hppa2.0w-hp-hpux11.11/3.5.0/f951 n11.f95
-quiet -dumpbase n11.f95 -auxbase n11 -version -o /var/tmp//ccCVK5zQ.s
GNU F95 version 3.5.0 20040611 (experimental) (hppa2.0w-hp-hpux11.11)
compiled by GNU C version 3.5.0 20040611 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
In file n11.f95:8
write(6,*) write(6,*) size(b)
1
Error: Syntax error in argument list at (1)
In file n11.f95:5
character(8) :: b(count(a < 'D'))
1
Error: Numeric operands are required in expression at (1)
subroutine x(a)
implicit none
character(8), intent(in) :: a(10)
character(8) :: b(count(a < 'D'))
write(6,*) size(b)
end subroutine x
--
Summary: Error when using count in initialization expression
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Mart dot Rentmeester at nn-online dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15963