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

            Bug ID: 82753
           Summary: (PDT) Invalid error for generic interface with
                    different KIND parameter values
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

As reported by FortranFan on clf:

module m
   type :: t(k)
      integer, kind :: k = 1
   contains
      procedure, pass(this) :: p1
      procedure, pass(this) :: p2
      generic :: p => p1, p2
   end type
contains
   subroutine p1( this )
      class(t(k=1)), intent(inout) :: this
   end subroutine
   subroutine p2( this )
      class(t(k=2)), intent(inout) :: this
   end subroutine
end module 

       generic :: p => p1, p2
                     1
Error: 'p1' and 'p2' for GENERIC 'p' at (1) are ambiguous
C:\dev\Fortran\temp\sor\m.f90:5:15:
       procedure, pass(this) :: p1
               1
Error: Argument 'this' of 'p1' with PASS(this) at (1) must be of the
derived-type 't'
C:\dev\Fortran\temp\sor\m.f90:6:15:
       procedure, pass(this) :: p2
               1
Error: Argument 'this' of 'p2' with PASS(this) at (1) must be of the
derived-type 't'
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) 

This is clearly incorrect. I am slightly surprised that this is happening,
since it should be the instances that are compared in the interface, but will
investigate asap.

Cheers

Paul

Reply via email to