This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/68226] ICE on wrong assignment of function pointer to allocatable


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

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
As a note, a correct code compiles and works :


$ cat z1ok.f90
program p
   type t
      integer :: n
   end type
   type(t), pointer :: a(:)
   a => f()
   print *, a
contains
   function f() result(r)
      class(t), pointer :: r(:)
      type(t), target :: b(2) = [t(1), t(2)]
      r => b
   end
end


$ gfortran -g -O0 -Wall -fcheck=all z1ok.f90
$ a.out
           1           2

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]