This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/82313] Rejects-valid for sum(minloc(...))) as array dimension
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 23 Jun 2018 23:24:56 +0000
- Subject: [Bug fortran/82313] Rejects-valid for sum(minloc(...))) as array dimension
- Auto-submitted: auto-generated
- References: <bug-82313-4@http.gcc.gnu.org/bugzilla/>
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.