I didn't add a test case yet, because there is one missing warning and
one wrong warning:
-----------------------------------
! { dg-do "compile" }
! Dummy arguments which are functions are allowed to have
! the Bind(c) flag set.
MODULE OpenGL_glut
IMPLICIT NONE
! Notes:
! (1) gives the wrong warning: "Variable 'func' is a parameter to the
! BIND(C) procedure 'glutcreatemenu' but may not be C interoperable"
! (2) gives no warning although integer has no C interop. kind.
INTERFACE
FUNCTION glutCreateMenu(func) BIND(C,NAME="glutCreateMenu")
use iso_c_binding ! ^^^^<<<<< (1)
INTEGER :: glutCreateMenu ! <<<<<<<< (2)
INTERFACE ! The dummy argument 'func'
SUBROUTINE func() BIND(C) ! is allowed to have the bind(c) flag set
END SUBROUTINE func
END INTERFACE
END FUNCTION glutCreateMenu
END INTERFACE
END MODULE OpenGL_glut
! { dg-final { cleanup-modules "OpenGL_glut" } }
-----------------------------------