http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53255

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |janus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-05-06 
08:54:29 UTC ---
What happens is the call to resolve_compcall, which in turn calls
resolve_typebound_generic_call. That procedure fails as
e->value.compcall.tbp->is_generic == false. I think that's okay as only .tr. is
generic, the "trace" is not.

However, somewhere in resolve_compcall or resolve_typebound_static it should
search for the overridden procedure.

The following seems to work. Janus: Do you think that the patch makes sense?

--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -5671,9 +5702,8 @@ resolve_typebound_static (gfc_expr* e, gfc_symtree**
target,
   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
+     that an overriding typebound procedure has not been missed.  */
+  if (e->value.compcall.name
        && !e->value.compcall.tbp->non_overridable
        && e->value.compcall.base_object
        && e->value.compcall.base_object->ts.type == BT_DERIVED)

Reply via email to