Commit 47feeb36 by Steven G. Kargl

re PR fortran/44491 (Diagnostic just shows "<During initialization>" instead of a locus)

2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/44491
	* expr.c (gfc_check_assign): Select non-NULL locus.

2018-06-12  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/44491
	* gfortran.dg/pr44491.f90: New testcase

From-SVN: r261516
parent bb0f14ae
2018-06-12 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/44491
* expr.c (gfc_check_assign): Select non-NULL locus.
2018-06-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/45521
......
......@@ -3414,6 +3414,8 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform,
/* Only DATA Statements come here. */
if (!conform)
{
locus *where;
/* Numeric can be converted to any other numeric. And Hollerith can be
converted to any other type. */
if ((gfc_numeric_ts (&lvalue->ts) && gfc_numeric_ts (&rvalue->ts))
......@@ -3423,8 +3425,9 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform,
if (lvalue->ts.type == BT_LOGICAL && rvalue->ts.type == BT_LOGICAL)
return true;
where = lvalue->where.lb ? &lvalue->where : &rvalue->where;
gfc_error ("Incompatible types in DATA statement at %L; attempted "
"conversion of %s to %s", &lvalue->where,
"conversion of %s to %s", where,
gfc_typename (&rvalue->ts), gfc_typename (&lvalue->ts));
return false;
......
2018-06-12 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/44491
* gfortran.dg/pr44491.f90: New testcase
2018-06-12 Martin Sebor <msebor@redhat.com>
PR c/85931
......
! { dg-do compile }
! { dg-options "-std=gnu" }
! PR fortran/44491
character*2 escape /z'1B'/ ! { dg-error "Incompatible types in DATA" }
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment