[Bug fortran/16674] New: Invalid code in specification expression accepted
Mart dot Rentmeester at nn-online dot org
gcc-bugzilla@gcc.gnu.org
Thu Jul 22 17:27:00 GMT 2004
In bug #15963 I reported that gfortran was inconsistent
in accepting arguments for the function 'count' when it
is used in a specification expression. This has been
fixed. That piece of code was the following:
subroutine x(a)
implicit none
character(8), intent(in) :: a(10)
character(8) :: b(count(a < 'D'))
write(6,*) size(b)
end subroutine x
However, I am currently testing the Absoft compiler and that
rejects the code anyway saying that 'count' is not allowed
to be used in a specification expression. After some digging
in Metcalf and Reid it appears they are right. 'count' is a
so-called 'transformational function', and those are not to
be used in specification expressions. If someone more
knowledgable about the standard can confirm this, then this
is a bug in gfortran (and all other compilers I know because
they accept it as well).
--
Summary: Invalid code in specification expression accepted
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=16674
More information about the Gcc-bugs
mailing list