[Bug fortran/83999] [8 Regression] ICE in gfc_trans_assignment_1, at fortran/trans-expr.c:10233

gscfq@t-online.de gcc-bugzilla@gcc.gnu.org
Tue Jan 23 17:50:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83999

--- Comment #1 from G. Steinmetz <gscfq@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


More information about the Gcc-bugs mailing list