Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
2 Views

Compiler Bug: derived type specifier in array constructor

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
Highlighted
Black Belt
2 Views

Still fails in 19.0. I concur

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

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos