[Bug fortran/82313] Rejects-valid for sum(minloc(...))) as array dimension
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jun 23 23:25:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82313
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #0)
> This is a spin-off from PR 54633.
>
> integer y((sum(minloc((/1/))))
> end
>
> is rejected with the (IMHO misleading) error message
>
> integer y((sum(minloc((/1/))))
> 1
> Error: Expected another dimension in array declaration at (1)
Why do you think it is misleading? You have essentially
integer y(1
gfortran cannot tell if you meant y(1) or y(1,2) or y(1,2,3) or etc.
I suppose one could change the error message to
Error: Expected another dimension or right parenthesis in
array declaration at 1
There are two locations where this error message can orginate.
Feel free to adopt my proposed message, commit a 'fix', and
close the PR.
More information about the Gcc-bugs
mailing list