Consider the following code:
module m
type Base
integer i
end type
type, extends(Base) :: Child
integer j
end type
end module
program argAssociation001
use m
type(Child), allocatable :: c
allocate(c, SOURCE=Child(2,-2))
call sub1(null(c))
contains
subroutine sub1(arg)
type(Child), allocatable :: arg
end subroutine
end
Flang issues an error as
t2.f:16:15: error: A null pointer may not be associated with allocatable dummy argument 'arg=' without INTENT(IN)
call sub1(null(c))
The code seems conforming to me as I can't find such constraint in the standard.
Both XLF and ifort compile the code successfully.