https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83999
--- Comment #1 from G. Steinmetz <gs...@t-online.de> --- Please note that a result with "type" instead of "class" gives : $ cat z2.f90 program p type t integer :: a end type type(t) :: x(3) x = f() print *, x contains elemental function f() result(z) type(t), pointer :: z(:) end end $ gfortran-8-20171112 -c z2.f90 z2.f90:9:3: elemental function f() result(z) 1 Error: ELEMENTAL function 'f' at (1) must have a scalar result $ gfortran-8-20180121 -c z2.f90 z2.f90:9:3: elemental function f() result(z) 1 Error: ELEMENTAL function 'f' at (1) must have a scalar result