Apparent regression in gfortran 4.1 and 4.2

Craig Powers enigma@hal-pc.org
Thu Aug 3 03:16:00 GMT 2006


Brooks Moses wrote:
> Tobias Burnus wrote:
> 
>> 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).
> 
> 
> Also worth noting is that the procedure, as shown in the original post, 
> is not in fact an ELEMENTAL procedure, despite what the error claims.

The error message looks like it's pointing at the addition, though, not 
the call to PRESENT.  (The other comment about it being related to a mix 
of REAL and COMPLEX data suggests that the complaint might be coming 
about due to conversion?)



More information about the Fortran mailing list