Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

possible compiler initialization expression bug

$
0
0

I am getting an initialization expression error for what I believe to be valid code (ifort version 17.0.1). A minimum working example is as below:

program test

    implicit none
    integer :: i, j
    integer, parameter :: L(4) = (/ -9, -4, 0, 4 /)
    integer, parameter :: U(4) = (/ -5, -1, 3, 9 /)
    integer, parameter :: A(-9:9) = (/ ( (/ (J, I = L(J), U(J)) /), J = 1, 4) /)

end program

This results in the compile error

testcase.f90(7): error #6973: This is not a valid initialization expression.   [J]
    integer, parameter :: A(-9:9) = (/ ( (/ (J, I = L(J), U(J)) /), J = 1, 4) /)
---------------------------------------------^
compilation aborted for testcase.f90 (code 1)

Thanks.


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>