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

--- Comment #8 from anlauf at gcc dot gnu.org ---
A slightly reduced & rewritten variant of the code in comment#6:

module m
  implicit none
  private
  public  :: cx, operator(+)
  private :: cx_plus_int        ! <- why does this make a difference?
  type cx
    integer :: re
  end type
  interface operator (+)
    module procedure cx_plus_int
  end interface
contains
  function cx_plus_int (z, r)
  entry    int_plus_cx (r, z)   ! <- why does this make a difference?
    type(cx), intent(in) :: z
    integer,  intent(in) :: r
    type(cx)             :: cx_plus_int, int_plus_cx
    cx_plus_int%re = z%re + r
  end function
end module

program p
  use m
  type(cx) :: a = cx(1)
  print *, (a + 2)
end

So there are multiple issues at work:
- the explicit "private :: cx_plus_int" should not make a difference;
  I think I've seen a related PR
- adding an entry that is otherwise unused changes the module
- the modified module when read seems to obstruct finding cx_plus_int,
  although the symbols still appears to be there...

Reply via email to