re PR fortran/47352 ([F03] ICE with proc-pointers in generic procedures)

2011-02-09  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47352
	* resolve.c (resolve_procedure_interface): If interface has a result
	variable, copy the typespec and set result pointer to self.


2011-02-09  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47352
	* gfortran.dg/proc_decl_25.f90: New.

From-SVN: r169987
This commit is contained in:
Janus Weil 2011-02-09 23:59:02 +01:00
parent 2181e7141c
commit c79bb35514
4 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2011-02-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/47352
* resolve.c (resolve_procedure_interface): If interface has a result
variable, copy the typespec and set result pointer to self.
2011-02-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/47463

View File

@ -160,7 +160,10 @@ resolve_procedure_interface (gfc_symbol *sym)
resolve_intrinsic (ifc, &ifc->declared_at);
if (ifc->result)
sym->ts = ifc->result->ts;
{
sym->ts = ifc->result->ts;
sym->result = sym;
}
else
sym->ts = ifc->ts;
sym->ts.interface = ifc;

View File

@ -1,3 +1,8 @@
2011-02-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/47352
* gfortran.dg/proc_decl_25.f90: New.
2011-02-09 Janus Weil <janus@gcc.gnu.org>
PR fortran/47463

View File

@ -0,0 +1,22 @@
! { dg-do compile }
!
! PR 47352: [F03] ICE with proc-pointers in generic procedures
!
! Contributed by James van Buskirk
! cf. http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/bbaf59ffd7c372e9
implicit none
abstract interface
real function f()
end function f
end interface
procedure(f) :: f1
interface gen
procedure f1
end interface gen
write(*,*) gen()
end