Bug 54035 - [OOP] TBP wrongly binds to a generic name if the specific name is the same
Summary: [OOP] TBP wrongly binds to a generic name if the specific name is the same
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: accepts-invalid
Depends on:
Reported: 2012-07-19 18:24 UTC by Tobias Burnus
Modified: 2012-07-21 09:35 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2012-07-21 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2012-07-19 18:24:10 UTC
Reported by Erik Toussaint in comp.lang.fortran,

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
        procedure, nopass :: sub
    end type

    interface sub
        procedure sub
        procedure sub2
    end interface
    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
Comment 1 janus 2012-07-21 08:50:43 UTC
Related: PR 42418.
Comment 2 janus 2012-07-21 09:35:49 UTC
The problem is really that we have only one symbol for the specific and generic procedure.