diff options
author | Janus Weil <janus@gcc.gnu.org> | 2008-12-02 12:58:16 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2008-12-02 12:58:16 +0100 |
commit | 726d8566c19edbbf347cac9dd93fd263a7fd8ce4 (patch) | |
tree | 1a8ed9bfe2933dce30e55e9615c3176bfb1bc126 /gcc/fortran/primary.c | |
parent | b72bbbcb08f999e3216f1a9bf3f82d7e72eb7123 (diff) | |
download | gcc-726d8566c19edbbf347cac9dd93fd263a7fd8ce4.zip gcc-726d8566c19edbbf347cac9dd93fd263a7fd8ce4.tar.gz gcc-726d8566c19edbbf347cac9dd93fd263a7fd8ce4.tar.bz2 |
re PR fortran/36704 (Procedure pointer as function result)
2008-12-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/36704
PR fortran/38290
* decl.c (match_result): Result may be a standard variable or a
procedure pointer.
* expr.c (gfc_check_pointer_assign): Additional checks for procedure
pointer assignments.
* primary.c (gfc_match_rvalue): Bugfix for procedure pointer
assignments.
* resolve.c (resolve_function): Check for attr.subroutine.
* symbol.c (check_conflict): Addtional checks for RESULT statements.
* trans-types.c (gfc_sym_type,gfc_get_function_type): Support procedure
pointers as function result.
2008-12-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/36704
PR fortran/38290
* gfortran.dg/entry_7.f90: Modified.
* gfortran.dg/proc_ptr_2.f90: Extended.
* gfortran.dg/proc_ptr_3.f90: Modified.
* gfortran.dg/proc_ptr_11.f90: New.
* gfortran.dg/proc_ptr_12.f90: New.
* gfortran.dg/result_1.f90: New.
From-SVN: r142351
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index f3e1b03..032fa90 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2509,11 +2509,10 @@ gfc_match_rvalue (gfc_expr **result) if (gfc_matching_procptr_assignment) { gfc_gobble_whitespace (); - if (sym->attr.function && gfc_peek_ascii_char () == '(') + if (gfc_peek_ascii_char () == '(') /* Parse functions returning a procptr. */ goto function0; - if (sym->attr.flavor == FL_UNKNOWN) sym->attr.flavor = FL_PROCEDURE; if (gfc_is_intrinsic (sym, 0, gfc_current_locus) || gfc_is_intrinsic (sym, 1, gfc_current_locus)) sym->attr.intrinsic = 1; |