This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/54035] New: [OOP] TBP wrongly binds to a generic name if the specific name is the same


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: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: janus@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]