The binary produced with the ifort 17.0.4 @ x86_64/Linux crashes, if a non-allocated class variable is passed to an optional dummy argument. The code below demonstrates the issue.
Best regards,
Bálint
module mymod implicit none type :: BaseType integer :: ii = 0 end type BaseType contains subroutine optional(bt) class(BaseType), optional :: bt print *, 'PRESENT:', present(bt) if (present(bt)) then bt%ii = 42 end if end subroutine optional end module mymod program myprog use mymod implicit none class(BaseType), allocatable :: btClass type(BaseType), allocatable :: btType allocate(btType) call move_alloc(btType, btClass) call optional(btClass) deallocate(btClass) ! Crashes here call optional(btClass) end program myprog