https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106684

--- Comment #2 from Jorn Bruggeman <j...@bolding-bruggeman.com> ---
I interpret the quoted F2018, 7.5.10 as "the same rules should govern
initialization of components of derived types and initialization of stand-alone
variables". That was previously (in 10.3, 11.2, and other compilers such as
ifort) the case: multidimensional arrays could be initialized with 1d data,
whether they were stand-alone variables or components of a derived type (note
that it was not just accepted by the compiler - it worked fine too). Now, in
10.4 and 11.3, that is no longer the case: the requirements on initialization
of type components have become more stringent as they demand the expression to
have the same rank. Assignments to stand-alone variables can still have
different rank.

Are you effectively saying that 10.3 and 11.2 (as well as all ifort versions I
am aware of) are too forgiving in both cases (accepting data of different rank
as long at the totals number of elements is the same), while 10.4 and 11.3 are
still too forgiving when it comes to stand-alone array variables?

Adding reshape does work - but it means the shape needs to be repeated twice,
once in the declaration and once in the assigned value, which seems suboptimal.

Reply via email to