- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
```
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There have been numerous IFX bugs reported relating to constant expressions to define a parameter. Do a forum search yours might be a repeat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page