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

BUG or SYNTAX ERROR? error #5082: Syntax error, found '::' when expecting one of: , : (/ ]

DataScientist
소중한 기여자 I
2,334 조회수

ifort 2022 (linux WSL) cannot compile the following code snippet.

Is the compiler error correct? Is line continuation disallowed in this case?

integer, allocatable :: A(:)
A = [integer &
:: 0]
end
0 포인트
1 솔루션
FortranFan
명예로운 기여자 III
2,320 조회수

Considering the Fortran standard document,

  1. Re: "Is the compiler error correct?" - no.  Intel Fortran does not conform by failing to process the continued statement.
  2. Re: "Is line continuation disallowed in this case?" - no.  Per the standard, the shown continuation is allowed.

원본 게시물의 솔루션 보기

7 응답
DataScientist
소중한 기여자 I
2,333 조회수

Here is an example run:

https://godbolt.org/z/rrcsE5TTf

0 포인트
FortranFan
명예로운 기여자 III
2,321 조회수

Considering the Fortran standard document,

  1. Re: "Is the compiler error correct?" - no.  Intel Fortran does not conform by failing to process the continued statement.
  2. Re: "Is line continuation disallowed in this case?" - no.  Per the standard, the shown continuation is allowed.
FortranFan
명예로운 기여자 III
2,320 조회수

A temporary workaround until a compiler resolution might be to move the double colon separator to the previous line:

   integer, allocatable :: A(:)
   A = [ integer :: &
       & 0 ]
end

 

Barbara_P_Intel
2,250 조회수

Uh, oh! This one almost slipped by!

Thanks for reporting it. I filed the bug as CMPLRLLVM-43404.



DataScientist
소중한 기여자 I
2,242 조회수

Fantastic. Thank you for your meticulous attention to bug reports and surely not the least, for the great compilers.

0 포인트
Ron_Green
중재자
1,762 조회수

We have a fix in the pipeline for this bug.  The fix will appear in the 2024.2.0 ( Update 2).  This is roughly due end of June or in July 2024.

DataScientist
소중한 기여자 I
1,759 조회수

fantastic! Thank you.

0 포인트
응답