https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86408
--- Comment #2 from janus at gcc dot gnu.org --- (In reply to janus from comment #0) > This error is apparently bogus, primarily because 'str' is not > assumed-length, but deferred-length. The following should be enough to distinguish deferred and assumed length (and makes the test case compile): Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 262304) +++ gcc/fortran/resolve.c (working copy) @@ -3115,7 +3115,7 @@ resolve_function (gfc_expr *expr) /* If this is a deferred TBP with an abstract interface, its result cannot be an assumed length character (F2003: C418). */ - if (sym && sym->attr.abstract && sym->attr.function + if (sym && sym->attr.abstract && sym->attr.function && !sym->ts.deferred && sym->result->ts.u.cl && sym->result->ts.u.cl->length == NULL) { I am about to regtest this ...