The default initialization of component foo is illegal in
8: type :: vec(k)
9: integer, len :: k=3
10: integer :: foo(k)=[1,2,3]
11: end type vec
as it violates C458 (F08) or C463 (F18). The NAG 6.1 compiler reports this error:
$ nagfor -kind=byte pdt_27.f03
NAG Fortran Compiler Release 6.1(Tozai) Build 6144
Questionable: pdt_27.f03, line 10: Shape of component FOO of type VEC depends on a kind type parameter but its default value has fixed shape
Error: pdt_27.f03, line 10: Type VEC default-initialised component FOO has a non-constant array bound
The default initialization of component
foo
is illegal inas it violates C458 (F08) or C463 (F18). The NAG 6.1 compiler reports this error: