From 871267e19da270df32c9ffe8be194228a14ddd87 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Mon, 17 Oct 2016 17:52:05 +0000 Subject: re PR fortran/61420 ([OOP] type-bound procedure returning a procedure pointer fails to compile) 2016-10-17 Paul Thomas PR fortran/61420 PR fortran/78013 * resolve.c (resolve_variable): Obtain the typespec for a variable expression, when the variable is a function result that is a procedure pointer. 2016-10-17 Paul Thomas PR fortran/61420 PR fortran/78013 * gfortran.dg/proc_ptr_49.f90: New test. From-SVN: r241274 --- gcc/fortran/resolve.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index e03979e..87178a4 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -5112,6 +5112,11 @@ resolve_variable (gfc_expr *e) if (sym->ts.type != BT_UNKNOWN) gfc_variable_attr (e, &e->ts); + else if (sym->attr.flavor == FL_PROCEDURE + && sym->attr.function && sym->result + && sym->result->ts.type != BT_UNKNOWN + && sym->result->attr.proc_pointer) + e->ts = sym->result->ts; else { /* Must be a simple variable reference. */ -- cgit v1.1