[flang-commits] [flang] [flang][semantic] Implement semantic checks and new data structure for explicit-shape-bounds-spec (PR #203030)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Thu Jul 30 07:35:44 PDT 2026


eugeneepshteyn wrote:

Awesome progress!

I do have another test for you to consider:
```
subroutine s1()
  implicit none
  interface
    impure integer function impf()
    end function
  end interface

  ! This generates an error, as expected:
  !integer, dimension(impf() : [integer::]) :: z1

  ! No error: '(5)' overrides the 'dimension' spec.
  ! On the other hand, 'integer, dimension(5.3) :: x(3)' has bad dimension
  ! spec that generates an error, so we should probably diagnoze impf() here
  ! as well.
  integer, dimension(impf() : [integer::]) :: z2(5)

  ! No error here either, even though x should for sure give an error.
  integer, dimension(impf() : [integer::]) :: z3(5), x

  z2(1) = 0
  z3(1) = 0
end
```
The lack of diagnostic for `x` especially concerns me: a stand-alone `z1` gets an error, but `x` with preceding `z3(5)` doesn't.  

https://github.com/llvm/llvm-project/pull/203030


More information about the flang-commits mailing list