Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
27551 Discussions

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

DataScientist
Valued Contributor I
188 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
174 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

5 Replies
DataScientist
Valued Contributor I
187 Views

Here is an example run:

https://godbolt.org/z/rrcsE5TTf

FortranFan
Honored Contributor II
175 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
174 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
104 Views

Uh, oh! This one almost slipped by!

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



DataScientist
Valued Contributor I
96 Views

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

Reply