OSDN Git Service

2009-04-09 Janus Weil <janus@gcc.gnu.org>
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Apr 2009 09:39:09 +0000 (09:39 +0000)
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Apr 2009 09:39:09 +0000 (09:39 +0000)
commit1e057e9bb0a329a9819696c3efbe6fcf4c7ececf
tree281a4a95643d1f27ef18644d79406042326b0862
parent2ed2ad5ed6499bfd59bda08b02ccc46df4a52e03
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145815 138bc75d-0d04-0410-961f-82ee72b054a4
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]