+2018-08-25 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/86545
+ * resolve.c (resolve_transfer): Correctly determine typespec for
+ generic function calls, in order to throw a proper error.
+
2018-08-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/86837
static void
resolve_transfer (gfc_code *code)
{
- gfc_typespec *ts;
gfc_symbol *sym, *derived;
gfc_ref *ref;
gfc_expr *exp;
_("item in READ")))
return;
- ts = exp->expr_type == EXPR_STRUCTURE ? &exp->ts : &exp->symtree->n.sym->ts;
+ const gfc_typespec *ts = exp->expr_type == EXPR_STRUCTURE
+ || exp->expr_type == EXPR_FUNCTION
+ ? &exp->ts : &exp->symtree->n.sym->ts;
/* Go to actual component transferred. */
for (ref = exp->ref; ref; ref = ref->next)
+2018-08-25 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/86545
+ * gfortran.dg/generic_35.f90: New test case.
+
2018-08-24 David Malcolm <dmalcolm@redhat.com>
PR 87091
--- /dev/null
+! { dg-do compile }
+!
+! PR 86545: ICE in transfer_expr on invalid WRITE statement
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+module m
+
+ type tString
+ character(len=:), allocatable :: cs
+ end type
+
+ interface my_trim
+ module procedure trim_string
+ end interface
+
+contains
+
+ elemental function trim_string(self) result(str)
+ type(tString) :: str
+ class(tString), intent(in) :: self
+ end function
+
+end module
+
+
+program p
+ use m
+ type(tString) :: s
+ write(*,*) my_trim(s) ! { dg-error "cannot have ALLOCATABLE components" }
+end