]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/fortran/array.cc
Save typespec for empty array constructor.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Thu, 9 Jan 2020 20:57:33 +0000 (20:57 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Thu, 9 Jan 2020 20:57:33 +0000 (20:57 +0000)
commitd636017868e7416675bb07491eb13ff4c8536702
tree4bea676547c2f7575236f6e24827373ffa143358
parent2b8ce6216e197e6243052b121c696ac5a5455b85
Save typespec for empty array constructor.

2020-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/65428
* array.c (empty_constructor): New variable.
(empty_ts): New variable.
(expand_constructor): Save typespec in empty_ts.
Unset empty_constructor if there is an element.
(gfc_expand_constructor): Initialize empty_constructor
and empty_ts.  If there was no explicit constructor
type and the constructor is empty, take the type from
empty_ts.

2020-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/65428
* gfortran.dg/zero_sized_11.f90: New test.

From-SVN: r280063
gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/zero_sized_11.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/zero_sized_12.f90 [new file with mode: 0644]