Skip to content

[flang] Missing diagnostic that an assumed-size array is being passed as the ac-value of an array constructor #131909

@DanielCChen

Description

@DanielCChen

Consider the following case:

real :: arr(4)
call sub(arr)
contains
  subroutine sub(arg)
    real :: arg(*)
    call sub2([arg]) !! Should be error
  end
  subroutine sub2(arg)
    real :: arg(:)
  end
end

An assumed-size array shall not be allowed as the ac-value of an array constructor as it doesn't provide the shape information.
All ifort, gfortran and XLF issue an error message.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions