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

Intel accepts CLASS & PARAMETER

Harald1
New Contributor II
529 Views

The Intel compiler accepts the following code silently:

program p
  type t
     integer :: i = 1
  end type t
  type(t),  parameter :: a = t() ! Legal
  class(t), parameter :: b = t() ! Likely not
  class(*), parameter :: c = t() ! Likely not
  class(*), parameter :: d = 1   ! Likely not
end

I've been informed that F2018 disallows the marked lines:

C708 An entity declared with the CLASS keyword shall be a dummy argument or have the ALLOCATABLE or POINTER attribute.

Is this due to a missing check in the compiler, or am I missing something?

Thanks,

Harald

 

0 Kudos
1 Solution
Barbara_P_Intel
Moderator
128 Views

Both ifx and ifort are printing error messages now! Please check out 2024.1 that was released last week.



View solution in original post

0 Kudos
4 Replies
Steve_Lionel
Honored Contributor III
518 Views

C708 An entity declared with the CLASS keyword shall be a dummy argument or have the ALLOCATABLE or POINTER attribute.

 

PARAMETER is right out.

0 Kudos
Barbara_P_Intel
Moderator
461 Views

Thanks for bringing this up. I filed a bug report for both ifort and ifx, CMPLRLLVM-37714.

This will be a two-for-1 fix, a 2-fer, since they share the Fortran Front End.

 

 

0 Kudos
Barbara_P_Intel
Moderator
129 Views

Both ifx and ifort are printing error messages now! Please check out 2024.1 that was released last week.



0 Kudos
Harald1
New Contributor II
91 Views

It is fixed indeed.  Great, thanks!

 

0 Kudos
Reply