Code or Compiler Error?

Confirmed this is a bug in Intel Fortran. A support request has been filed with their software team.

The standard states in the section on Specification Expression, “A specification inquiry is a reference to … the COMPILER_VERSION or COMPILER_OPTIONS function from the intrinsic module ISO_FORTRAN_ENV (16.10.2.6, 16.10.2.7).”

The use of a specification inquiry with constant expression arguments are allowed in a constant expression, among other things. There are no parameters to the compiler_version and compiler_options functions, so they are covered.

Thus the use of compiler_version and compiler_options in the definition of a named constant is permitted and Intel Fortran compiler is incorrect in issuing the error diagnostic.

2 Likes