This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/67884] Missing error message on required allocatable attribute
- From: "gerhard dot steinmetz dot fortran at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Oct 2015 19:02:49 +0000
- Subject: [Bug fortran/67884] Missing error message on required allocatable attribute
- Auto-submitted: auto-generated
- References: <bug-67884-4 at http dot gcc dot gnu dot org/bugzilla/>
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