------- Comment #12 from burnus at gcc dot gnu dot org 2010-07-09 08:48 ------- For intrinsic modules, we currently have:
use iso_c_binding, only: c_null_ptr which use-associates a constant (PARAMETER) of the type "c_ptr" - but "c_ptr" is not imported directly; to make the type information available, gfortran currently imports "c_ptr" in a hidden way (_gfortran_...). But the problem is the same for nonintrinsic modules. Thus, the question is: How does it work there - it obviously does: module m type t; end type end module m module m2 use m ! private; public :: null type(t), parameter :: null = t() end module m2 module m3 use m ! private; public :: sub contains subroutine sub(x); type(t) :: x; end subroutine end module m3 use m2, only: null use m3, only: sub call sub(null) contains subroutine sub2(); use m; type(t) :: y; y = null; end subroutine end -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37829