Issue 125878
Summary [Flang] Incorrect diagnostic on `v_list` in defined I/O
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code
```
module m
    type base
        real(4), allocatable :: d1
    end type

    interface read(formatted)
 subroutine formattedRead (dtv, unit, iotype, v_list, iostat, iomsg)
 import base
            class (base), intent(inout) :: dtv
 integer, intent(in) :: unit
            character(*), intent(in) :: iotype
 integer, intent(in) :: v_list(2:)  !<-- this is legal
 integer, intent(out) :: iostat
            character(*), intent(inout) :: iomsg
        end subroutine
    end interface
end module

```

Flang currently issues an error as:
```
./t.f:12:36: error: Dummy argument 'v_list' of a defined input/output procedure must be deferred shape
 integer, intent(in) :: v_list(2:)  !<-- this is legal
 ^^^^^^
```

1. The code is valid.
2. The error message complains about "deferred shape" where the `v_list` is supposed to be "assumed-shape". 

All ifort, gfortran and XLF compile the code successfully.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to