------- 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