As reported by Chris:
For the following code, the bind(C) is ignored when calling the private
specific subroutine "test" via calling the generic procedure "gen".
Result: The procedure "test_" is called and the linker complains.

If one makes "test" public, it works. As -fdump-parse-tree shows (after
applying the fixes from PR34186), in "main" "test" has the "bind(c)" attribute.

subroutine test() bind(c)
end subroutine test

module mod
  private
  public :: gen
  interface gen
     subroutine test() bind(c)
     end subroutine test
  end interface gen
end module mod

program main
  use mod
  call gen
end program main


-- 
           Summary: BIND(C): Public generic with private bind(c) specific
                    does not use bind(C) name
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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

Reply via email to