aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2018-06-12 17:55:24 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2018-06-12 17:55:24 +0000
commit47feeb36526b106053ad8d4fc7a64c23ce16f5de (patch)
tree67474afcd6b0875cc3dc2410ec9ed85f46f67046 /gcc/fortran/expr.c
parentbb0f14ae684a38a44aaf42b312c213aedaa74103 (diff)
downloadgcc-47feeb36526b106053ad8d4fc7a64c23ce16f5de.zip
gcc-47feeb36526b106053ad8d4fc7a64c23ce16f5de.tar.gz
gcc-47feeb36526b106053ad8d4fc7a64c23ce16f5de.tar.bz2
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
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index e6ab822..a1336d2 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -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;