[Bug fortran/25104] better diagnostic needed
eedelman at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Nov 30 14:19:00 GMT 2005
------- Comment #2 from eedelman at gcc dot gnu dot org 2005-11-30 14:18 -------
(In reply to comment #1)
> What broken here? Where are the details?
I wondered that as well for a while. The problem, IIUC is that the
case-selector
must be an initialization expression. I'm no language lawyer, but if I
understand the F2003 (draft) standard, MAXLOC(k,1), where 'k' is a PARAMETER,
ought to be a perfectly valid initialization expression. The standard, section
7.1.7, says on initialization expressions:
"It is an expression in which each operation is intrinsic, and each primary is
[...]
(5) A reference to a transformational standard intrinsic function other than
NULL, where each argument is an initialization expression,"
MAXLOC, is, AFAIK, a transformational standard intrinsic, and 'k' and 1 are,
AFAIK, initialization expressions.
It turns out, however, that the F95 standard has a slightly different
definition
of initialization expressions (in section 7.1.6.1); it seems that MAXLOC is not
allowed here. So it seems the code is still invalid F95, and we should give a
warning/error message if strict F95 standard checking is requested. I must,
however, say, that I find it a bit wierd that MAXLOC isn't allowed in this
context, so I'm not sure what to think here ... I leave this as unconfirmed
for now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25104
More information about the Gcc-bugs
mailing list