Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28839 Discussions

ifx issue with %kind inquiry of complex variable when passing to procedure; works with ifort

Harald1
New Contributor II
107 Views

Dear all,

the following reproducer shows a oddity with the %kind inquiry of particularly a complex variable:

program p
  implicit none
  real         :: r(3)
  complex      :: z(3)
  logical      :: l(3)
  character(5) :: s(7)
  print *, r%kind ! all of these are OK ...
  print *, l%kind
  print *, s%kind
  print *, s%len
  print *, z%kind
  call bla(r%kind)
  call bla(l%kind)
  call bla(s%kind)
  call bla(s%len)  ! ... until here
  call bla(z%kind) ! this one accepted by ifort 2021.13.1, rejected by ifx
contains
  subroutine bla(r)
    integer, intent(in) :: r
    print *, "r=", r
  end subroutine
end

While ifort accepts the code and prints expected values, the indicated line is rejected by ifx (up to 2025.0):

% ifx ifx-kind-inquiry.f90
ifx-kind-inquiry.f90(16): error #8748: Type parameter inquiry must not be used in a leftside context.   [KIND]
  call bla(z%kind) ! accepted by ifort 2021.13.1, rejected by ifx
-------------^
compilation aborted for ifx-kind-inquiry.f90 (code 1)

This error cannot be right...

Thanks,

Harald

 

0 Kudos
1 Reply
Devorah_H_Intel
Moderator
70 Views

I have escalated this case to compiler engineering for a fix. Thanks for the report and test case. 

0 Kudos
Reply