Open ThemosTsikas opened 6 years ago
Indeed. Seems like ifort 18 catches this:
$ ifort ieee/ieee_8.f90
ieee/ieee_8.f90(23): error #6259: This array or function or substring is invalid in constant expressions. [IEEE_SUPPORT_HALTING]
logical, parameter :: l1 = ieee_support_halting(ieee_overflow)
-----------------------------^
ieee/ieee_8.f90(24): error #6259: This array or function or substring is invalid in constant expressions. [IEEE_SUPPORT_FLAG]
logical, parameter :: l2 = ieee_support_flag(ieee_overflow)
-----------------------------^
ieee/ieee_8.f90(25): error #6259: This array or function or substring is invalid in constant expressions. [IEEE_SUPPORT_FLAG]
logical, parameter :: l3 = ieee_support_flag(ieee_overflow, 0.)
-----------------------------^
ieee/ieee_8.f90(26): error #6259: This array or function or substring is invalid in constant expressions. [IEEE_SUPPORT_ROUNDING]
logical, parameter :: l4 = ieee_support_rounding(ieee_to_zero)
-----------------------------^
ieee/ieee_8.f90(27): error #6259: This array or function or substring is invalid in constant expressions. [IEEE_SUPPORT_ROUNDING]
logical, parameter :: l5 = ieee_support_rounding(ieee_to_zero, 0.d0)
-----------------------------^
ieee/ieee_8.f90(29): error #6259: This array or function or substring is invalid in constant expressions. [XXX]
logical, parameter :: l6 = xxx(ieee_to_zero, 0.d0)
This was nag-20180203d.f90 in https://github.com/nncarlson/fortran-compiler-tests. I've deleted it.
The ieee_8.f90 test
ignores the Technical Corrigendum 4 (http://isotc.iso.org/livelink/livelink?func=ll&objId=18597225&objAction=Open) items which correct the standard to make IEEE_SUPPORT_FLAG, IEEE_SUPPORT_HALTING and IEEE_SUPPORT_ROUNDING Transformational functions instead of Inquiry. According to the rules for constant expressions, these functions cannot be used in constant expressions.