Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26730 Discussions

Compiler Bug: derived type specifier in array constructor

Rodrigo_R_
Beginner
76 Views

Hi.

I am getting a syntax error when trying to construct an array with a type specifier, when the type is a derived type.

program test
  type :: tp
   integer :: a
  end type

  type(tp) :: u(0) = [tp ::]
  ! error #5082: Syntax error, found '::' when expecting one of: ] , (/ :
  type(tp) :: v(2) = [tp :: tp(0), tp(1)]
  ! error #5082: Syntax error, found '::' when expecting one of: ] , (/ :
  type(tp) :: w(2) = [tp(0), tp(1)]
  ! no error
  integer :: x(2) = [integer :: 0, 1]
  ! no error
end

 

My compiler version is 18.0.2.185 Build 20180210 x64 on Windows.

I can compiler and run the sample code without problems in gfortran.

0 Kudos
1 Reply
Steve_Lionel
Black Belt Retired Employee
76 Views

Still fails in 19.0. I concur that the syntax should be accepted. Please report this through https://supporttickets.intel.com/?lang=en-US

Reply