Skip to content

[flang] Missing diagnostic on non-rank-1 v_list in formattedRead #138933

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

Closed
DanielCChen opened this issue May 7, 2025 · 1 comment · Fixed by #139329
Closed

[flang] Missing diagnostic on non-rank-1 v_list in formattedRead #138933

DanielCChen opened this issue May 7, 2025 · 1 comment · Fixed by #139329
Assignees

Comments

@DanielCChen
Copy link
Contributor

Consider the following code:

module m
    type base
        real(4), allocatable :: d1
    end type
end module

program fdtio001d1
use m
    interface read(formatted)
        subroutine formattedRead (dtv, unit, iotype, v_list, iostat, iomsg)
        use m
            class (base), intent(inout) :: dtv
            integer, intent(in) :: unit
            character(*), intent(in) :: iotype
            integer, intent(in) :: v_list(:,:)  !<-- must be rank 1
            integer, intent(out) :: iostat
            character(*), intent(inout) :: iomsg
        end subroutine
    end interface
end

The v_list argument should be rank-1. This code should be diagnosed.

@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/issue-subscribers-flang-frontend

Author: Daniel Chen (DanielCChen)

Consider the following code: ``` module m type base real(4), allocatable :: d1 end type end module

program fdtio001d1
use m
interface read(formatted)
subroutine formattedRead (dtv, unit, iotype, v_list, iostat, iomsg)
use m
class (base), intent(inout) :: dtv
integer, intent(in) :: unit
character(), intent(in) :: iotype
integer, intent(in) :: v_list(:,:) !<-- must be rank 1
integer, intent(out) :: iostat
character(
), intent(inout) :: iomsg
end subroutine
end interface
end


The `v_list` argument should be rank-1. This code should be diagnosed.
</details>

@klausler klausler self-assigned this May 9, 2025
klausler added a commit to klausler/llvm-project that referenced this issue May 9, 2025
Catch assumed-rank arguments to defined I/O subroutines, and ensure
that v_list dummy arguments are vectors.

Fixes llvm#138933.
klausler added a commit that referenced this issue May 12, 2025
Catch assumed-rank arguments to defined I/O subroutines, and ensure that
v_list dummy arguments are vectors.

Fixes #138933.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this issue May 12, 2025
Catch assumed-rank arguments to defined I/O subroutines, and ensure that
v_list dummy arguments are vectors.

Fixes llvm/llvm-project#138933.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants