[flang-commits] [flang] [Flang][Semantics] Fix incorrect merging of separate module procedure interfaces during USE association (PR #197173)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Mon Jul 20 10:51:35 PDT 2026


================

----------------
eugeneepshteyn wrote:

Also consider the following. If you compile these files separately with `-pedantic`, there's no warning:

First file:
```
module parent_mod_11
   interface
      subroutine inside_one()
      end subroutine
   end interface
 end module
```

Second file:
```
submodule (parent_mod_11) sub_11
 contains
   subroutine inside_one()
   end subroutine
 end submodule
```

On the other hand, if you combine them, you get a warning:
```
$ flang -c -pedantic p14combined.f90 
p14combined.f90:14:15: portability: Subprogram 'inside_one' in this submodule hides an external interface from its parent module; did you mean 'MODULE SUBROUTINE'? [-Wportability]
     subroutine inside_one()
                ^^^^^^^^^^
```
I think module check needs to be adjusted to allow for this case.

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


More information about the flang-commits mailing list