This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35723] Can't use run-time array element in character declaration
- From: "domob at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Sep 2008 10:28:54 -0000
- Subject: [Bug fortran/35723] Can't use run-time array element in character declaration
- References: <bug-35723-15620@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from domob at gcc dot gnu dot org 2008-09-25 10:28 -------
I guess this is illegal, too:
PROGRAM main
IMPLICIT NONE
CALL test (5, (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /) )
CONTAINS
SUBROUTINE test (n, arr)
IMPLICIT NONE
INTEGER :: n, arr(:)
INTEGER :: i = 5
INTEGER :: local(arr(n))
INTEGER :: local2(arr(i)) ! { dg-error "XXX" }
END SUBROUTINE test
END PROGRAM main
where the definition of local is ok, but local2 is illegal. This program is
however accepted with gfortran without your patch. I will implement general
checking of the references for EXPR_VARIABLEs that have one.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35723