Commit 003e0ad6 by Paul Thomas

PR fortran/PR48946

2012-01-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/PR48946
	* resolve.c (resolve_typebound_static): If the typebound
	procedure is 'deferred' try to find the correct specific
	procedure in the derived type operator space itself.

2012-01-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/PR48946
	* gfortran.dg/typebound_operator_9.f03: This is now a copy of
	the old typebound_operator_8.f03.
	* gfortran.dg/typebound_operator_8.f03: New version of
	typebound_operator_7.f03 with 'u' a derived type instead of a
	class object.

From-SVN: r182929
parent f7d6ad0a
2012-01-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/PR48946
* resolve.c (resolve_typebound_static): If the typebound
procedure is 'deferred' try to find the correct specific
procedure in the derived type operator space itself.
2012-01-04 Mikael Morin <mikael@gcc.gnu.org> 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/50981 PR fortran/50981
......
...@@ -5614,6 +5614,39 @@ resolve_typebound_static (gfc_expr* e, gfc_symtree** target, ...@@ -5614,6 +5614,39 @@ resolve_typebound_static (gfc_expr* e, gfc_symtree** target,
e->ref = NULL; e->ref = NULL;
e->value.compcall.actual = NULL; e->value.compcall.actual = NULL;
/* If we find a deferred typebound procedure, check for derived types
that an over-riding typebound procedure has not been missed. */
if (e->value.compcall.tbp->deferred
&& e->value.compcall.name
&& !e->value.compcall.tbp->non_overridable
&& e->value.compcall.base_object
&& e->value.compcall.base_object->ts.type == BT_DERIVED)
{
gfc_symtree *st;
gfc_symbol *derived;
/* Use the derived type of the base_object. */
derived = e->value.compcall.base_object->ts.u.derived;
st = NULL;
/* If necessary, go throught the inheritance chain. */
while (!st && derived)
{
/* Look for the typebound procedure 'name'. */
if (derived->f2k_derived && derived->f2k_derived->tb_sym_root)
st = gfc_find_symtree (derived->f2k_derived->tb_sym_root,
e->value.compcall.name);
if (!st)
derived = gfc_get_derived_super_type (derived);
}
/* Now find the specific name in the derived type namespace. */
if (st && st->n.tb && st->n.tb->u.specific)
gfc_find_sym_tree (st->n.tb->u.specific->name,
derived->ns, 1, &st);
if (st)
*target = st;
}
return SUCCESS; return SUCCESS;
} }
......
2012-01-05 Jakub Jelinek <jakub@redhat.com> 2012-01-05 Paul Thomas <pault@gcc.gnu.org>
PR debug/51762 PR fortran/PR48946
* gcc.dg/pr51762.c: New test. * gfortran.dg/typebound_operator_9.f03: This is now a copy of
the old typebound_operator_8.f03.
PR rtl-optimization/51767 * gfortran.dg/typebound_operator_8.f03: New version of
* gcc.c-torture/compile/pr51767.c: New test. typebound_operator_7.f03 with 'u' a derived type instead of a
class object.
PR middle-end/51768
* c-c++-common/pr51768.c: New test.
PR middle-end/44777
* gcc.dg/tree-prof/pr44777.c: New test.
2012-01-05 Jan Hubicka <jh@suse.cz>
PR middle-end/49710
* gcc.c-torture/compile/pr49710.c: New file.
2012-01-05 Richard Guenther <rguenther@suse.de> 2012-01-05 Richard Guenther <rguenther@suse.de>
......
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