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/67884] Missing error message on required allocatable attribute


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

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Whereas, detected with explicit result variable :

$ cat z5a.f90
program p
   integer i
   print *, [(f(i), i=1,3)]
contains
   function f(n) result(z)
      integer :: n
      character(:) :: z
      character(3) :: c = 'abc'
      z = c(n:n)
   end
end

$ gfortran -g -O0 -Wall -fcheck=all z5a.f90
z5a.f90:5:26:

    function f(n) result(z)
                          1
Error: Entity 'z' at (1) has a deferred type parameter and requires either the
pointer or allocatable attribute


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