This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/38205] New: Tranformational function SUM rejected in initialization expressions
- 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: 20 Nov 2008 22:55:57 -0000
- Subject: [Bug fortran/38205] New: Tranformational function SUM rejected in initialization expressions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program fails with:
Error: transformational intrinsic 'sum' at (1) is not permitted in an
initialization expression
I think it is valid Fortran 2003 per "7.1.7 Initialization expression":
"(5) A reference to a transformational standard intrinsic function other than
NULL, where each argument is an initialization expression"
Note: Fortran 95 7.1.7.1 the program is invalid (only few transformational
functions are allowed).
Found by James Van Buskirk:
http://groups.google.com/group/comp.lang.fortran/msg/2119be02dcf93517
integer, parameter :: a = sum([1,2])
print *, a
end
--
Summary: Tranformational function SUM rejected in initialization
expressions
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38205