Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Parameter expression bugs

JFH
New Contributor I
1,278 Views

Ifx -stand f23 gives 3 error messages for this program, but the type parameter inquiry x%kind and aimag(z) in a constant expression both became valid Fortran in 2003; the complex part designator x%im became valid Fortran in 2008. F2023 5.4.3.2.4 implies that a subobject need not be a variable. The program and its compile-time messages:
```
program imconsts
implicit none ! file imconsts.f90
complex,parameter :: z = (5,7)/9.0
integer,parameter :: zk = z%kind
real ,parameter :: zi1 = aimag(z), zi2 = z%im
print "(I0,2F10.7)", zk, zi1, zi2
end program imconsts


(lf) john:~$ intel/oneapi/compiler/2025.1/bin/ifx -stand f23 imconsts.f90
imconsts.f90(4): error #7747: Invalid parameter expression. [Z]
integer,parameter :: zk = z%kind
-----------------------------^
imconsts.f90(5): warning #6009: Fortran 2023 specifies that an elemental intrinsic function here be of type integer or character and each argument must be an initialization expr of type integer or character. [AIMAG]
real ,parameter :: zi1 = aimag(z), zi2 = z%im
-----------------------------^
imconsts.f90(5): error #7747: Invalid parameter expression. [Z]
real ,parameter :: zi1 = aimag(z), zi2 = z%im
---------------------------------------------^
compilation aborted for imconsts.f90 (code 1)
```

Labels (2)
0 Kudos
3 Replies
andrew_4619
Honored Contributor III
1,207 Views

There have been numerous IFX bugs reported relating to constant expressions to define a parameter. Do a forum search yours might be a repeat.

0 Kudos
JFH
New Contributor I
1,160 Views

The only repeat I found is that the %kind bug was said to have been fixed in ifx 2025.0 but it's back again in 2025.1. See @sblionel's bug report and the reply in these screenshots:

 

0 Kudos
taehunkim
Employee
1,053 Views

Hi,

We also found that ifx does not support for the initialization of the derived type in the declaration section and started triaging it with development team.

Thanks.

Reply