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

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

DataScientist
Précieux contributeur I
2 338 Visites

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 Compliments
1 Solution
FortranFan
Contributeur émérite III
2 324 Visites

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.

Voir la solution dans l'envoi d'origine

7 Réponses
DataScientist
Précieux contributeur I
2 337 Visites

Here is an example run:

https://godbolt.org/z/rrcsE5TTf

0 Compliments
FortranFan
Contributeur émérite III
2 325 Visites

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
Contributeur émérite III
2 324 Visites

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
Employé
2 254 Visites

Uh, oh! This one almost slipped by!

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



DataScientist
Précieux contributeur I
2 246 Visites

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

0 Compliments
Ron_Green
Modérateur
1 766 Visites

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
Précieux contributeur I
1 763 Visites

fantastic! Thank you.

0 Compliments
Répondre