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

             Bug #: 54035
           Summary: [OOP] TBP wrongly binds to a generic name if the
                    specific name is the same
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org
                CC: ja...@gcc.gnu.org


Reported by Erik Toussaint in comp.lang.fortran,
http://www.rhinocerus.net/forum/lang-fortran/710071-tbp-generic.html

The problem occurs if a generic name is a specific name – and the specific name
is used in a type-bound procedure.

As the example shows, the type-bound procedure becomes also generic – and thus
  "call type%proc"
is all of a sudden generic.


module foo
    implicit none

    type t1
    contains
        procedure, nopass :: sub
    end type

    interface sub
        procedure sub
        procedure sub2
    end interface
contains
    subroutine sub
        print *, 'sub1'
    end subroutine

    subroutine sub2(arg1)
        integer arg1

        print *, 'sub2'
    end subroutine
end module

program bar
    use foo
    implicit none

    type(t1) obj

    call obj%sub
    call obj%sub(0)
end program

Reply via email to