2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521
* array.c (gfc_resolve_character_array_constructor): Substrings
with upper bound smaller than lower bound are zero length strings.
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521
* gfortran.dg/pr85521_1.f90: New test.
* gfortran.dg/pr85521_2.f90: New test.
From-SVN: r260139
+2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/85521
+ * array.c (gfc_resolve_character_array_constructor): Substrings
+ with upper bound smaller than lower bound are zero length strings.
+
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/70870
else
return true;
- gcc_assert (current_length != -1);
+ if (current_length < 0)
+ current_length = 0;
if (found_length == -1)
found_length = current_length;
+2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/85521
+ * gfortran.dg/pr85521_1.f90: New test.
+ * gfortran.dg/pr85521_2.f90: New test.
+
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/70870
--- /dev/null
+! { dg-do compile }
+! PR fortran/85521
+program p
+ character(3) :: c = 'abc'
+ character(3) :: z(1)
+ z = [ c(:-1) ]
+ print *, z
+end
--- /dev/null
+! { dg-do compile }
+! PR fortran/85521
+program p
+ character(3) :: c = 'abc'
+ character(3) :: z(1)
+ z = [ c(:-2) ]
+ print *, z
+end