Apparent regression in gfortran 4.1 and 4.2

Tobias Burnus burnus@net-b.de
Wed Aug 2 15:40:00 GMT 2006


Hi,

Martin Reinecke wrote:
>   complex arg1 (:)
>   real, optional :: arg2 (:)

>     arg1 = arg1 + arg2
>                      1
> Error: 'arg2' at (1) is an array and OPTIONAL; it cannot therefore be an
> actual argument of an ELEMENTAL procedure unless there is a non-optional
> argument with the same rank (12.4.1.5)
>
> Is this code really ill-formed? If yes, how would it be written correctly?
> If it is a gfortran bug, please let me know and I'll open a PR.

This seems to be a bug in gfortran as both arrays have the same rank
(namely one).

The problem is seemingly that arg1 is complex and arg2 is real. If one
changes both to real or both to complex, the error does not appear.

Tobias

PS: Thanks for finding the bug.



More information about the Fortran mailing list