f18
f18 copied to clipboard
Confusing parse error on bad codimension
Test case:
real :: a[1:10,1:10]
end
Compiling this, f18 give the following errors:
t.f90:1:6: error: expected '('
real :: a[1:10,1:10]
^
t.f90:1:1: in the context: statement function definition
real :: a[1:10,1:10]
^
t.f90:1:1: in the context: declaration construct
t.f90:1:1: in the context: specification part
t.f90:1:1: in the context: main program
A similar error occurs with real, codimension[1:10,1:10] :: a
Here's another example: real :: a[1:*](4)
ifort produces "error #7271: Not a valid attribute for the DEC$ ATTRIBUTES directive." so things could be worse.
gfortran does well on real :: a[1:10,1:10]
:
Error: Upper bound of last coarray dimension must be '*'
But not so well on real, dimension(5) :: a[1:10,1:*](4,4)
:
f951: internal compiler error: free_expr0(): Bad expr type