------- Comment #5 from burnus at gcc dot gnu dot org 2008-01-12 14:36 ------- A related but slightly separate issue is illustrated by the following example. The argument of the second call to FOO is an expression; however, expressions involving assumed-size arrays are evil. This is detected for assignments: "Error: The upper bound in the last dimension must appear in the reference to the assumed size array 'a' at (1)", but not for actual arguments. (Note: Procedure calls are in so far different as passing the assumed-size array itself it valid.)
subroutine one(a) external foo integer :: a(*) integer :: b call foo(a) ! ok call foo((a)) ! Wrong call foo(a+1) ! Wrong b = a+1 ! diagnosed as being invalid end subroutine -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34665