Skip to content

[flang][Semantics] Invalid semantic error with external dummy procedures #110797

@daniel-otero

Description

@daniel-otero

The following reduced snippet, doesn't compile with flang-new but it runs correctly on GNU and Intel compilers:

module mod
    interface
        module subroutine doall(f)
            external f
        end subroutine
    end interface
end module

submodule (mod) doall_sub
    contains
        module subroutine doall(f)
            external f
            call f(34)
        end subroutine
end submodule

 program test
    use mod
    call doall(sprint)
    contains
        subroutine sprint(i)
            integer :: i
            print*,i
        end subroutine
end program

The reported error:

error: Semantic errors in test.f90
./test.f90:11:33: error: Dummy procedure 'f' does not match the corresponding argument in the interface body
          module subroutine doall(f)
                                  ^
./test.f90:3:33: Declaration of 'f'
          module subroutine doall(f)
                                  ^

Tested with flang-new version 20.0.0git (https://github.com/llvm/llvm-project 32ffc9fdc2cd422c88c926b862adb3de726e3888).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions