Code below compiles and functions as expected with Intel 2013, 15, and 16. Intel 17 gives ICE. Other compilers seem to handle it as well. We have a workaround in the "big" code, but would be curious to know if this is valid code or not.
ifort (IFORT) 17.0.1 20161005
Copyright (C) 1985-2016 Intel Corporation. All rights reserved.
Thanks!
Eric
module prob type ddt1 real :: f ! function real :: d ! the derivatives of f end type ddt1 interface assignment(=) module procedure ddt1_assign_rd end interface contains function fun_rd(v1) result(f1) real, intent(in) :: v1 type(ddt1) :: f1 f1%f = v1 f1%d = 0.0 end function fun_rd subroutine ddt1_assign_rd(r, d) real, intent(out) :: r type(ddt1), intent(in) :: d r = d%f end subroutine ddt1_assign_rd end module program problem use prob implicit none real :: var1 var1 = 1.0 var1 = fun_rd(var1) print *, var1 end program problem