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

--- Comment #20 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Aug 30, 2019 at 07:43:54PM +0000, anlauf at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91556
> 
> --- Comment #19 from anlauf at gcc dot gnu.org ---
> (In reply to Thomas Koenig from comment #18)
> > (In reply to anlauf from comment #14)
> > > The current solution is a bit annoying for implicitly-derived interfaces.
> > > 
> > > Consider a code like:
> > > 
> > > module foo
> > >   implicit none
> > >   type t1
> > >      integer :: i = 1
> > >   end type t1
> > >   type t2
> > >      integer :: j = 2
> > >   end type t2
> > > contains
> > >   subroutine s1 (x)
> > >     type(t1) :: x
> > >     call my_mpi_bcast_wrapper (x, storage_size (x)/8)
> > >   end subroutine s1
> > >   subroutine s2 (y)
> > >     type(t2) :: y
> > >     call my_mpi_bcast_wrapper (y, storage_size (y)/8)
> > >   end subroutine s2
> > > end module foo
> > > 
> > > That's perfectly legal,
> > 
> > This is illegal, as far as I know. The type names are different,
> > which makes them different types.
> 
> Of course the types are different - that's the point!
> 
> The above is an attempt to extract a self-contained example demonstrating
> what does happen in real-world codes using MPI.  You can convert it to the
> real thing yourself (see e.g. man mpi_bcast).
> 

From the Fortran standard (actually 18-007r1.pdf), page 304.

15.5.2.4 Ordinary dummy variables

2 The dummy argument shall be type compatible with the actual argument.

How can the dummy argument be type compatiable with two distinct
different types for the actual arguments x and y in your example?

Reply via email to