Skip to content

[flang][semantics] implicit none may leak to other program units #159977

@foxtran

Description

@foxtran

With the following example:

module t
  common /fmcom2/ e, z(1)
end module t
subroutine test(n)
  use t
  implicit none
  integer :: n
end subroutine test

flang produces the following output:

error: Semantic errors in /app/example.f90
/app/example.f90:2:19: error: No explicit type declared for 'e'
    common /fmcom2/ e, z(1)
                    ^
/app/example.f90:2:22: error: No explicit type declared for 'z'
    common /fmcom2/ e, z(1)
                       ^
Compiler returned: 1

Flang version:

flang version 22.0.0git (https://github.com/llvm/llvm-project.git 678dcf13d8fa9c1e5086864ff998e068cbb3160c)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Example on godbolt:

https://godbolt.org/z/zM7W6z5sd

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions