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
Novice
208 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
2 Replies
Steve_Lionel
Black Belt Retired Employee
197 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.

Barbara_P_Intel
Moderator
140 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.

 

 

Reply