Found by Damian - and ask at http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f5ec99089ea72b79# gfortran rejects call type%abstract_parent%tbp() with Error: Base object for type-bound procedure call at (1) is of ABSTRACT type 'abstract_parent' As long as "abstract_parent%tbp" is not deferred, I believe the call is valid and (if not overridden) identically to "type%tpb()", which is accepted. The check has to be modified to only reject DEFERRED procedures. Regarding the standard, deferred procedures are invalid as outlined in Note 4.50. I think it is buried in C427 (R429) If the type definition contains or inherits (4.5.6.1) a deferred binding (4.5.4), ABSTRACT shall appear. However, as any dynamic object is not abstract, one cannot invoke a deferred procedure.
Draft patch: Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (Revision 157097) +++ gcc/fortran/resolve.c @@ -4902,10 +4902,11 @@ check_typebound_baseobject (gfc_expr* e) gcc_assert (base->ts.type == BT_DERIVED || base->ts.type == BT_CLASS); - if (base->ts.type == BT_DERIVED && base->ts.u.derived->attr.abstract) + if (e->value.compcall.tbp->deferred) { - gfc_error ("Base object for type-bound procedure call at %L is of" - " ABSTRACT type '%s'", &e->where, base->ts.u.derived->name); + gfc_error ("Type bound-bound procedure of base type '%s' in call " + "at %L has a DEFERRED binding", base->ts.u.derived->name, + &e->where); return FAILURE; }
Close as INVALID. Patch posted was: http://gcc.gnu.org/ml/fortran/2010-02/msg00225.html However, Jim Xia thinks it is invalid - and I think he is right - as C611 has: R611 data-ref is part-ref [ % part-ref ] ... C611 (R611) If the rightmost part-name is of abstract type, data-ref shall be polymorphic. Thus, a data-ref something%parent, parent needs to by polymorphic (CLASS). And for the call, one has: R1219 procedure designator is [...] or data-ref % binding-name thus in something%parent%binding_name "parent" needs to be polymorphic, i.e. not abstract.