+2018-07-05 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/86408
+ * resolve.c.c (resolve_contained_fntype): Reference to C418 is
+ in F2008 and not F2003.
+ (resolve_function): Ditto in error message. Also, exclude
+ deferred character length results from the error.
+
2018-07-05 Fritz Reese <fritzoreese@gmail.com>
PR fortran/83183
}
}
- /* Fortran 2003 Draft Standard, page 535, C418, on type-param-value
+ /* Fortran 2008 Draft Standard, page 535, C418, on type-param-value
type, lists the only ways a character length value of * can be used:
dummy arguments of procedures, named constants, function results and
in allocate statements if the allocate_object is an assumed length dummy
cannot be an assumed length character (F2003: C418). */
if (sym && sym->attr.abstract && sym->attr.function
&& sym->result->ts.u.cl
- && sym->result->ts.u.cl->length == NULL)
+ && sym->result->ts.u.cl->length == NULL
+ && !sym->result->ts.deferred)
{
gfc_error ("ABSTRACT INTERFACE %qs at %L must not have an assumed "
- "character length result (F2003: C418)", sym->name,
+ "character length result (F2008: C418)", sym->name,
&sym->declared_at);
return false;
}
+2018-07-05 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/86408
+ * gfortran.dg/deferred_character_20.f90: New test.
+
2018-07-05 Fritz Reese <fritzoreese@gmail.com>
PR fortran/83183
--- /dev/null
+! { dg-do compile }
+!
+! Test the fix for PR86408.
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+!
+module m
+
+ implicit none
+
+ type, abstract :: t
+ contains
+ procedure(ifc), deferred :: tbf
+ procedure :: tbs
+ end type
+
+ abstract interface
+ function ifc(x) result(str)
+ import :: t
+ class(t) :: x
+ character(len=:), allocatable :: str
+ end function
+ end interface
+
+contains
+
+ subroutine tbs(x)
+ class(t) :: x
+ print *, x%tbf()
+ end subroutine
+
+end