aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/iresolve.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2016-11-07 19:33:27 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2016-11-07 19:33:27 +0000
commit39b4b34de01ef3cc035d0f42b31c171be2af3c7a (patch)
tree0f41f6dc1da3c15e7735fc3fd4a56653bb15b923 /gcc/fortran/iresolve.c
parent98a989094b11c0e5395b127d84fe0eb65191feda (diff)
downloadgcc-39b4b34de01ef3cc035d0f42b31c171be2af3c7a.zip
gcc-39b4b34de01ef3cc035d0f42b31c171be2af3c7a.tar.gz
gcc-39b4b34de01ef3cc035d0f42b31c171be2af3c7a.tar.bz2
re PR fortran/78226 (Fill out location information everywhere)
2016-11-07 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/78226 * expr.c (gfc_generate_initializer): Add where to EXPR_NULL statement. * iresolve.c (gfc_resolve_extends_type_of): Add where to both arguments of the function. * resolve.c (resolve_select_type): Add where to the second argument of the new statement. From-SVN: r241927
Diffstat (limited to 'gcc/fortran/iresolve.c')
-rw-r--r--gcc/fortran/iresolve.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 078e47d..b289c9f 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -1044,15 +1044,19 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
gfc_add_vptr_component (a);
else if (a->ts.type == BT_DERIVED)
{
+ locus where;
+
vtab = gfc_find_derived_vtab (a->ts.u.derived);
/* Clear the old expr. */
gfc_free_ref_list (a->ref);
+ where = a->where;
memset (a, '\0', sizeof (gfc_expr));
/* Construct a new one. */
a->expr_type = EXPR_VARIABLE;
st = gfc_find_symtree (vtab->ns->sym_root, vtab->name);
a->symtree = st;
a->ts = vtab->ts;
+ a->where = where;
}
/* Replace the second argument with the corresponding vtab. */
@@ -1060,8 +1064,11 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
gfc_add_vptr_component (mo);
else if (mo->ts.type == BT_DERIVED)
{
+ locus where;
+
vtab = gfc_find_derived_vtab (mo->ts.u.derived);
/* Clear the old expr. */
+ where = mo->where;
gfc_free_ref_list (mo->ref);
memset (mo, '\0', sizeof (gfc_expr));
/* Construct a new one. */
@@ -1069,6 +1076,7 @@ gfc_resolve_extends_type_of (gfc_expr *f, gfc_expr *a, gfc_expr *mo)
st = gfc_find_symtree (vtab->ns->sym_root, vtab->name);
mo->symtree = st;
mo->ts = vtab->ts;
+ mo->where = where;
}
f->ts.type = BT_LOGICAL;