aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-01-30 19:17:29 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2011-01-30 19:17:29 +0100
commit1ca99f75ca11563319c58de89dfc240271111cb3 (patch)
tree1d5c731149ad7a87275126d01690668b1248c152 /gcc/fortran/resolve.c
parent86d7449cc673e466a64f2ad6203c3461049596ba (diff)
downloadgcc-1ca99f75ca11563319c58de89dfc240271111cb3.zip
gcc-1ca99f75ca11563319c58de89dfc240271111cb3.tar.gz
gcc-1ca99f75ca11563319c58de89dfc240271111cb3.tar.bz2
re PR fortran/47042 (ICE with character pointer in function)
2011-01-31 Tobias Burnus <burnus@net-b.de> PR fortran/47042 * resolve.c (resolve_fl_procedure): Reject stmt functions with pointer/allocatable attribute. 2011-01-31 Tobias Burnus <burnus@net-b.de> PR fortran/47042 * gfortran.dg/stmt_func_1.f90: New. From-SVN: r169415
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c8
1 files changed, 8 insertions, 0 deletions
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