Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing parse error on bad codimension #381

Open
tskeith opened this issue Apr 2, 2019 · 3 comments
Open

Confusing parse error on bad codimension #381

tskeith opened this issue Apr 2, 2019 · 3 comments
Assignees

Comments

@tskeith
Copy link
Collaborator

tskeith commented Apr 2, 2019

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

@tskeith
Copy link
Collaborator Author

tskeith commented Apr 2, 2019

Here's another example: real :: a[1:*](4)

@klausler
Copy link
Collaborator

klausler commented Apr 2, 2019

ifort produces "error #7271: Not a valid attribute for the DEC$ ATTRIBUTES directive." so things could be worse.

@klausler klausler self-assigned this Apr 2, 2019
@tskeith
Copy link
Collaborator Author

tskeith commented Apr 2, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants