This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/68243] QOI: no warning about unused entities in submodules


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

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #1)
> Confirmed.

Isn't this testcase a demonstration that unused3 and unused4 can be used
outside of m2?

module m1
  implicit none
  private
  interface
    module subroutine s1
    end subroutine
  end interface
  public s1
  integer unused1
contains
  subroutine unused2
  end subroutine
end module

submodule (m1) m2
  implicit none
  integer :: unused3 = 9
contains
  subroutine unused4
    unused3 = 99
  end subroutine
end submodule

submodule (m1:m2) m3
  implicit none
contains
  module procedure s1
    print *, unused3
    call unused4
    print *, unused3
  end procedure
end submodule

  use m1
  call s1
end

Cheers

Paul

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]