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

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

DataScientist
Valued Contributor I
879 Views

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 Kudos
1 Solution
FortranFan
Honored Contributor II
865 Views

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.

View solution in original post

7 Replies
DataScientist
Valued Contributor I
878 Views

Here is an example run:

https://godbolt.org/z/rrcsE5TTf

0 Kudos
FortranFan
Honored Contributor II
866 Views

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
Honored Contributor II
865 Views

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
Moderator
795 Views

Uh, oh! This one almost slipped by!

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



DataScientist
Valued Contributor I
787 Views

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

0 Kudos
Ron_Green
Moderator
307 Views

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
Valued Contributor I
304 Views

fantastic! Thank you.

0 Kudos
Reply