././src/RAY3D_libunit.f90(58): error #6780: A dummy argument with the INTENT(IN) attribute shall not be defined nor become undefined. [CALCUL]
call testr(calcul%re, attendu%re, precision)
-------------------^
No problem with gfortran 14.2.0.
I had the strange intuition to put those access to the real part of a complex between parenthesis:
call testr((calcul%re), (attendu%re), precision)
and now ifx compiles it without problem.
Is there any reason for this behavior?
Itβs a mistake, the compiler is issuing an error for conforming code. Putting the designator X%RE in brackets forces interpretation of the actual argument as an expression, which cannot become defined or undefined, so the check for this spurious error is not done.
Arguably, leaving the workaround brackets in the source is a good reminder to the next human that those complex variables are not going to be modified by the procedure reference.
Here is a minimalist fpm project reproducing the error with ifx:
module strange
implicit none
private
public :: say_hello
contains
subroutine receive(x, y)
real, intent(in) :: x, y
end subroutine
subroutine inter(z)
complex, intent(in) :: z
call receive(z%re, z%im)
end subroutine
subroutine say_hello
complex :: z = (2.0, 3.0)
call inter(z)
end subroutine
end module strange
I needed to add the inter(z) subroutine to reproduce the error. Calling the receive() subroutine directly from say_hello would compile.
$ fpm run --compiler ifx
fpm: Entering directory '/tmp/strange'
strange.f90 failed.
[ 25%] Compiling...
././src/strange.f90(13): error #6780: A dummy argument with the INTENT(IN) attribute shall not be defined nor become undefined. [Z]
call receive(z%re, z%im)
-----------------^
I tried adapting your test to see if the %kind designator also triggers problems, but it appears to work. Probably the %kind designator is treated differently at the level of types, and not like %re and %im which need to exist at the level of variables.