In the current implementation of GENERIC type-bound procedures the check if two
specific targets of a GENERIC binding could be ambiguous (see standard 16.2.3
Restrictions on generic declarations) is not conformant with this section as it
does not handle passed-objects at the moment.  The following code is accepted:

MODULE m

  TYPE t
  CONTAINS
    PROCEDURE, PASS :: proc1
    PROCEDURE, NOPASS :: proc2
    GENERIC :: gen => proc1, proc2
  END TYPE t

CONTAINS

  SUBROUTINE proc1 (me)
    IMPLICIT NONE
    TYPE(t) :: me
  END SUBROUTINE proc1

  SUBROUTINE proc2 ()
    IMPLICIT NONE
  END SUBROUTINE proc2

END MODULE m

PROGRAM main
  USE m
  IMPLICIT NONE

  TYPE(t) :: myobj

  CALL myobj%gen ()
END PROGRAM main

While the CALL in the main-program would fit to both specific targets.


-- 
           Summary: Ambiguity check for F2003 GENERIC bindings is not yet
                    fully conformant
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: domob at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37297

Reply via email to