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

G. Steinmetz <gs...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #1 from G. Steinmetz <gs...@t-online.de> ---

More variants :


$ cat zz1.f90
function f()
   character(:), allocatable :: f
   f = 'abc'
   call s
contains
   subroutine s
      print *, f
   end
end


$ cat zz2.f90
function f()
   character(:), pointer :: f
   f = 'abc'
   call s
contains
   subroutine s
      print *, f
   end
end



And a working one without an inner s :


$ cat za1.f90
function f()
   character(:), allocatable :: f
   f = 'abc'
end
program p
   interface
      function f()
         character(:), allocatable :: f
      end
   end interface
   print *, f()
end


$ gfortran-11-20200531 za1.f90 && ./a.out
 abc
$

Reply via email to