]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR fortran/36704 (Procedure pointer as function result)
authorJanus Weil <janus@gcc.gnu.org>
Thu, 9 Apr 2009 09:39:09 +0000 (11:39 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Thu, 9 Apr 2009 09:39:09 +0000 (11:39 +0200)
commit3070bab4c9421f35fd4149a238768befd2717ddb
tree281a4a95643d1f27ef18644d79406042326b0862
parentb61ee1aa7b06fe0c5d970a943aa8451c1e04c97d
re PR fortran/36704 (Procedure pointer as function result)

2009-04-09  Janus Weil  <janus@gcc.gnu.org>

PR fortran/36704
* decl.c (add_hidden_procptr_result): New function for handling
procedure pointer return values by adding a hidden result variable.
(variable_decl,match_procedure_decl,gfc_match_function_decl,
gfc_match_subroutine,gfc_match_end,attr_decl1): Handle procedure pointer
return values.
* parse.c (parse_interface): Add EXTERNAL attribute only after
FUNCTION/SUBROUTINE declaration is complete.
* primary.c (replace_hidden_procptr_result): New function for replacing
function symbol by hidden result variable.
(gfc_match_rvalue,match_variable): Replace symbol by hidden result
variable.
* resolve.c (resolve_contained_fntype,resolve_function,resolve_variable,
resolve_symbol): Allow for procedure pointer function results.
(resolve_fl_procedure): Conflict detection moved here from
'check_conflict'.
* symbol.c (gfc_check_function_type): Allow for procedure pointer
function results.
(check_conflict): Move some conflict detection to resolution stage.
* trans-types.c (gfc_sym_type,gfc_get_function_type): Handle hidden
result variables.

2009-04-09  Janus Weil  <janus@gcc.gnu.org>

PR fortran/36704
* gfortran.dg/external_procedures_1.f90: Modified.
* gfortran.dg/proc_ptr_result_1.f90: New.
* gfortran.dg/proc_ptr_result_2.f90: New.
* gfortran.dg/proc_ptr_result_3.f90: New.

From-SVN: r145815
12 files changed:
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/parse.c
gcc/fortran/primary.c
gcc/fortran/resolve.c
gcc/fortran/symbol.c
gcc/fortran/trans-types.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/external_procedures_1.f90
gcc/testsuite/gfortran.dg/proc_ptr_result_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/proc_ptr_result_2.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/proc_ptr_result_3.f90 [new file with mode: 0644]