diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-01-30 19:17:29 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-01-30 19:17:29 +0100 |
commit | 1ca99f75ca11563319c58de89dfc240271111cb3 (patch) | |
tree | 1d5c731149ad7a87275126d01690668b1248c152 /gcc/fortran | |
parent | 86d7449cc673e466a64f2ad6203c3461049596ba (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 888432e..ecdf2de 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,6 +1,12 @@ 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 * interface.c (gfc_procedure_use): Add explicit interface check for pointer/allocatable functions. 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 |