Commit 7db5da56 by Janus Weil

re PR fortran/36322 (ICE with PROCEDURE using a complicated interface)

2008-06-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36322
	PR fortran/36275
	* resolve.c (resolve_symbol): Correctly copy the interface for a
	PROCEDURE declaration.


2008-06-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/36322
	PR fortran/36275
	* gfortran.dg/proc_decl_2.f90: Extended.

From-SVN: r136372
parent b30199b8
2008-06-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/36322
PR fortran/36275
* resolve.c (resolve_symbol): Correctly copy the interface for a
PROCEDURE declaration.
2008-06-02 Janus Weil <janus@gcc.gnu.org> 2008-06-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/36361 PR fortran/36361
......
...@@ -7893,11 +7893,12 @@ resolve_symbol (gfc_symbol *sym) ...@@ -7893,11 +7893,12 @@ resolve_symbol (gfc_symbol *sym)
/* Get the attributes from the interface (now resolved). */ /* Get the attributes from the interface (now resolved). */
if (sym->ts.interface->attr.if_source || sym->ts.interface->attr.intrinsic) if (sym->ts.interface->attr.if_source || sym->ts.interface->attr.intrinsic)
{ {
sym->ts.type = sym->ts.interface->ts.type; gfc_symbol *ifc = sym->ts.interface;
sym->ts.kind = sym->ts.interface->ts.kind; sym->ts = ifc->ts;
sym->attr.function = sym->ts.interface->attr.function; sym->ts.interface = ifc;
sym->attr.subroutine = sym->ts.interface->attr.subroutine; sym->attr.function = ifc->attr.function;
copy_formal_args (sym, sym->ts.interface); sym->attr.subroutine = ifc->attr.subroutine;
copy_formal_args (sym, ifc);
} }
else if (sym->ts.interface->name[0] != '\0') else if (sym->ts.interface->name[0] != '\0')
{ {
......
2008-06-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/36322
PR fortran/36275
* gfortran.dg/proc_decl_2.f90: Extended.
2008-06-04 Joseph Myers <joseph@codesourcery.com> 2008-06-04 Joseph Myers <joseph@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com> Maxim Kuvyrkov <maxim@codesourcery.com>
......
...@@ -4,16 +4,27 @@ ...@@ -4,16 +4,27 @@
module m module m
use ISO_C_BINDING
abstract interface abstract interface
subroutine csub() bind(c) subroutine csub() bind(c)
end subroutine csub end subroutine csub
end interface end interface
integer, parameter :: ckind = C_FLOAT_COMPLEX
abstract interface
function stub() bind(C)
import ckind
complex(ckind) stub
end function
end interface
procedure():: mp1 procedure():: mp1
procedure(real), private:: mp2 procedure(real), private:: mp2
procedure(mfun), public:: mp3 procedure(mfun), public:: mp3
procedure(csub), public, bind(c) :: c, d procedure(csub), public, bind(c) :: c, d
procedure(csub), public, bind(c, name="myB") :: b procedure(csub), public, bind(c, name="myB") :: b
procedure(stub), bind(C) :: e
contains contains
...@@ -32,6 +43,15 @@ contains ...@@ -32,6 +43,15 @@ contains
procedure(a), optional :: b procedure(a), optional :: b
end subroutine bar end subroutine bar
subroutine bar2(x)
abstract interface
character function abs_fun()
end function
end interface
procedure(abs_fun):: x
end subroutine
end module end module
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment