Even the most underwhelming Christmas present needs wrapping
print *, [[integer::]] end
But on Linux, ifort 16,17,18,19(.0.3):
error #7203: An ac-value-list of an array-constructor must contain at least one ac-value. print *, [[integer::]]
Also gfortran 9.1.0:
1 | print *, [[integer::]] | internal compiler error: in gfc_typenode_for_spec, at fortran/trans-types.c:1120
Nobody likes underwhelming Christmas presents.
Peculiar. The extra set of brackets seems to be the key here. Note that this isn't specifying a rank-two array, since:
If an ac-value is a scalar expression, its value specifies an element of the array constructor. If an ac-value is an array expression, the values of the elements of the expression, in array element order (22.214.171.124), specify the corresponding sequence of elements of the array constructor.
Both compilers are wrong here, in different ways. Please report this to Intel using the Online Service Portal You can report it on Bugzilla against gfortran.
Yeah, it is an interesting (...but also stupid) case, as the outer 'wrapping' brakets are pretty useless. I have reported it nevertheless. Thanks.
PS: concerning gfortran, this bug was reported in 2015 here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65428
I've been seeing gripes from the few remaining gfortran developers that a lot of old, lower-priority bugs aren't getting worked on because there's no one to do so.
It should have printed a blank line since the I/O list was an empty (zero-element) array. The code shown is functionally identical to:
print *, [integer::] end
(Note only one set of brackets.) This is a zero-element array of default integer type/kind.
To make it a bit more obvious:
print *, [integer::[1,2,3],4,5] end
1 2 3 4 5