+2016-12-02 Janus Weil <janus@gcc.gnu.org>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/78618
+ * check.c (gfc_check_rank): Remove ATTRIBUTE_UNUSED.
+ * expr.c (gfc_check_assign): Fix error propagation.
+
2016-12-01 Elizebeth Punnoose <elizebeth.punnoose@hpe.com>
PR fortran/77505
bool
-gfc_check_rank (gfc_expr *a ATTRIBUTE_UNUSED)
+gfc_check_rank (gfc_expr *a)
{
/* Any data object is allowed; a "data object" is a "constant (4.1.3),
variable (6), or subobject of a constant (2.4.3.2.3)" (F2008, 1.3.45). */
if (lvalue->ts.type == BT_CHARACTER && rvalue->ts.type == BT_CHARACTER)
{
if (lvalue->ts.kind != rvalue->ts.kind && allow_convert)
- gfc_convert_chartype (rvalue, &lvalue->ts);
-
- return true;
+ return gfc_convert_chartype (rvalue, &lvalue->ts);
+ else
+ return true;
}
if (!allow_convert)
+2016-12-02 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/78618
+ * gfortran.dg/char_conversion.f90: New test.
+
2016-12-02 Jakub Jelinek <jakub@redhat.com>
PR target/70322
--- /dev/null
+! { dg-do compile }
+!
+! PR 78618: ICE in gfc_check_rank, at fortran/check.c:3670
+!
+! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
+
+program p
+ character, parameter :: c = char(256,4) ! { dg-error "cannot be converted" }
+ if (rank(c) /= 0) call abort
+end