[Patch, Fortran] PR 41873 & 41556

Janus Weil janus@gcc.gnu.org
Wed Nov 4 22:36:00 GMT 2009


Hi all,

here is a patch for PR 41873, which also fixes a part of PR 41556. The
problem was that a check, which prevents abstract interfaces from
being called, falsely triggered an error for deferred type-bound
procedures with abstract interface.

My solution to this may be a bit hackish, but it works very good in
practice: To distinguish both cases I simply check certain fields,
which are always set for the TBP case, but not for plain abstract
interfaces.

When working on this PR, I also noticed that the check for calling
abstract subroutines was missing completely (only functions were
checked), so I also added this (again distinguishing TBPs).

The patch regtests without failures on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


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

	PR fortran/41556
	PR fortran/41873
	* resolve.c (resolve_function,resolve_call): Prevent abstract interfaces
	from being called, but allow deferred type-bound procedures with
	abstract interface.


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

	PR fortran/41556
	PR fortran/41873
	* gfortran.dg/interface_abstract_4.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr41873.diff
Type: text/x-diff
Size: 1161 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091104/4b919508/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interface_abstract_4.f90
Type: application/octet-stream
Size: 716 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091104/4b919508/attachment.obj>


More information about the Gcc-patches mailing list