From 1ca99f75ca11563319c58de89dfc240271111cb3 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Sun, 30 Jan 2011 19:17:29 +0100 Subject: re PR fortran/47042 (ICE with character pointer in function) 2011-01-31 Tobias Burnus PR fortran/47042 * resolve.c (resolve_fl_procedure): Reject stmt functions with pointer/allocatable attribute. 2011-01-31 Tobias Burnus PR fortran/47042 * gfortran.dg/stmt_func_1.f90: New. From-SVN: r169415 --- gcc/fortran/resolve.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/fortran/resolve.c') diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 55b5183..20be0d1 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -10231,6 +10231,14 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) return FAILURE; } + if (sym->attr.proc == PROC_ST_FUNCTION + && (sym->attr.allocatable || sym->attr.pointer)) + { + gfc_error ("Statement function '%s' at %L may not have pointer or " + "allocatable attribute", sym->name, &sym->declared_at); + return FAILURE; + } + /* 5.1.1.5 of the Standard: A function name declared with an asterisk char-len-param shall not be array-valued, pointer-valued, recursive or pure. ....snip... A character value of * may only be used in the -- cgit v1.1