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

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

DataScientist
Colaborador Valioso I
1.740 Vistas

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 Solución
FortranFan
Colaborador Distinguido III
1.726 Vistas

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.

Ver la solución en mensaje original publicado

7 Respuestas
DataScientist
Colaborador Valioso I
1.739 Vistas

Here is an example run:

https://godbolt.org/z/rrcsE5TTf

FortranFan
Colaborador Distinguido III
1.727 Vistas

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
Colaborador Distinguido III
1.726 Vistas

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
Empleados
1.656 Vistas

Uh, oh! This one almost slipped by!

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



DataScientist
Colaborador Valioso I
1.648 Vistas

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

Ron_Green
Moderador
1.168 Vistas

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
Colaborador Valioso I
1.165 Vistas

fantastic! Thank you.

Responder