re PR fortran/39946 (PROCEDURE statements: interface with RESULT variable)

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

	PR fortran/39946
	* resolve.c (resolve_symbol): Correctly copy the interface of a
	PROCEDURE statement if the interface involves a RESULT variable.


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

	PR fortran/39946
	* gfortran.dg/proc_ptr_16.f90: New.

From-SVN: r146905
This commit is contained in:
Janus Weil 2009-04-28 18:27:27 +02:00
parent f1028b9da4
commit e6a5e544f7
4 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-04-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/39946
* resolve.c (resolve_symbol): Correctly copy the interface of a
PROCEDURE statement if the interface involves a RESULT variable.
2009-04-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/39930

View File

@ -9244,7 +9244,10 @@ resolve_symbol (gfc_symbol *sym)
if (ifc->attr.intrinsic)
resolve_intrinsic (ifc, &ifc->declared_at);
sym->ts = ifc->ts;
if (ifc->result)
sym->ts = ifc->result->ts;
else
sym->ts = ifc->ts;
sym->ts.interface = ifc;
sym->attr.function = ifc->attr.function;
sym->attr.subroutine = ifc->attr.subroutine;

View File

@ -1,3 +1,8 @@
2009-04-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/39946
* gfortran.dg/proc_ptr_16.f90: New.
2009-04-28 Steve Ellcey <sje@cup.hp.com>
* testsuite/gcc.target/ia64/sync-1.c: Check for cmpxchg8 only if

View File

@ -0,0 +1,20 @@
! { dg-do compile }
!
! PR 39946: PROCEDURE statements: interface with RESULT variable
!
! Original test case by Juergen Reuter <reuter@physik.uni-freiburg.de>
! Modified by Janus Weil <janus@gcc.gnu.org>
procedure(prc_is_allowed), pointer :: fptr
interface
function prc_is_allowed (flv, hel, col) result (is_allowed)
logical :: is_allowed
integer, intent(in) :: flv, hel, col
end function prc_is_allowed
end interface
fptr => prc_is_allowed
end