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

--- Comment #4 from Denis <dmitrievdv242 at gmail dot com> ---
(In reply to Thomas Koenig from comment #2)
> (In reply to Denis from comment #0)
> 
> > The bug occurs when you have a module with some name (lets name it init) and
> > it uses a module with an aliased subroutine or function with the same name
> > (init) - see the attached source file. 
> 
> That is invalid, right?

No, this is valid, because 'init' module doesn't use the module with this
subroutine. It uses the module, in which this subroutine is aliased as
'test_init'. And the real 'init' subroutine is in another module. So, the
module used in 'init' doesn't actually contain the 'init' subroutine and it is
expected that 'init' module doesn't care about the existence of this
subroutine. See the source file for clarification. 

Also I believe this must work even with directly aliased subroutine, like:

module init
  use test, test_init => init
  ...
  ...
end module init

Because this is one of the reasons aliases exist: to prevent name conflicts.

Reply via email to