[Bug fortran/92736] New: Error when using a variable from a module in a submodule and its parent module.

chinoune.mehdi at hotmail dot com gcc-bugzilla@gcc.gnu.org
Sat Nov 30 05:55:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92736

            Bug ID: 92736
           Summary: Error when using a variable from a module in a
                    submodule and its parent module.
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chinoune.mehdi at hotmail dot com
  Target Milestone: ---

gfortran recently start to reject this code :

module m1
  implicit none
  integer, parameter :: i = 10
end module m1

module m2
  use m1, only : i
  implicit none
  interface
    module subroutine sb1()
    end subroutine sb1
  end interface
end module m2

submodule(m2) s1
  use m1, only : i
  implicit none
contains
  module subroutine sb1
    print*,"hello"
  end subroutine sb1
end submodule s1

gfortran-9 -c file.f90
   15 | submodule(m2) s1                                                        
      |            1                                                            
   16 |   use m1, only : i                                                      
      |                  2                                                     
                                                                     Error:
Symbol ‘i’ at (1) conflicts with the symbol at (2)

The error message is not clear!

I can compile it using gfortran 8.3.0 and 9.2.0, but it fails with 9.2.1 and
10.0
I think this is where it started failing :
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=274609
https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=274608


More information about the Gcc-bugs mailing list