diff options
author | Janus Weil <janus@gcc.gnu.org> | 2009-05-25 16:48:24 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2009-05-25 16:48:24 +0200 |
commit | c74b74a8b2f8a5996943128e574f429670537361 (patch) | |
tree | 68abe1bd5f023825be92c3ec2ac271318c3baa9e /gcc/fortran/primary.c | |
parent | 6b8ed1452b9f79918ba9324edda6642ed7d08114 (diff) | |
download | gcc-c74b74a8b2f8a5996943128e574f429670537361.zip gcc-c74b74a8b2f8a5996943128e574f429670537361.tar.gz gcc-c74b74a8b2f8a5996943128e574f429670537361.tar.bz2 |
re PR fortran/40176 (Fortran 2003: Procedure pointers with array return value)
2009-05-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/40176
* primary.c (gfc_match_varspec): Handle procedure pointer components
with array return value.
* resolve.c (resolve_expr_ppc): Ditto.
(resolve_symbol): Make sure the interface of a procedure pointer has
been resolved.
* trans-array.c (gfc_walk_function_expr): Handle procedure pointer
components with array return value.
* trans-expr.c (gfc_conv_component_ref,gfc_conv_procedure_call,
gfc_trans_arrayfunc_assign): Ditto.
(gfc_trans_pointer_assignment): Handle procedure pointer assignments,
where the rhs is a dummy argument.
* trans-types.c (gfc_get_ppc_type,gfc_get_derived_type): Handle
procedure pointer components with array return value.
2009-05-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/40176
* gfortran.dg/proc_ptr_18.f90: New.
* gfortran.dg/proc_ptr_19.f90: New.
* gfortran.dg/proc_ptr_comp_9.f90: New.
* gfortran.dg/proc_ptr_comp_10.f90: New.
From-SVN: r147850
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 4d39c1a..1a03165 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1726,7 +1726,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, tail = NULL; gfc_gobble_whitespace (); - if ((equiv_flag && gfc_peek_ascii_char () == '(') || sym->attr.dimension) + if ((equiv_flag && gfc_peek_ascii_char () == '(') + || (sym->attr.dimension && !sym->attr.proc_pointer)) { /* In EQUIVALENCE, we don't know yet whether we are seeing an array, character variable or array of character @@ -1843,7 +1844,7 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, break; } - if (component->as != NULL) + if (component->as != NULL && !component->attr.proc_pointer) { tail = extend_ref (primary, tail); tail->type = REF_ARRAY; |