[Patch, Fortran, OOP] PR 56284: ICE with alternate return in type-bound procedure

Janus Weil janus@gcc.gnu.org
Mon Apr 1 21:08:00 GMT 2013


Hi all,

here is a small patch which does two things:
1) It fixes the ICE in the subject line (in a rather obvious way).
2) It warns about alternate-return arguments (which is an obsolescent
feature), and adds -std=legacy to some test cases to suppress the
warning.

Regarding the second point, one should mention that we already have a
warning for "alternate return", but this only triggers if there is an
actual RETURN statement (which is not the case for the test code in
the PR). The warning I'm adding triggers on the appearance of an
asterisk argument.

This induces a certain redundancy, i.e. we warn about both the
alternate-return argument and the alternate RETURN statement. The
question is if we want to keep this, or whether on can remove the old
warning for the RETURN statement (which could be done in a follow-up
patch).

The patch is regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2013-04-01  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/56284
    PR fortran/40881
    * decl.c (gfc_match_formal_arglist): Warn about alternate-return
    arguments.
    * interface.c (check_dummy_characteristics): Return if symbols are NULL.

2013-04-01  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/56284
    PR fortran/40881
    * gfortran.dg/altreturn_8.f90: New.
    * gfortran.dg/altreturn_2.f90: Add -std=legacy.
    * gfortran.dg/intrinsic_actual_3.f90: Ditto.
    * gfortran.dg/invalid_interface_assignment.f90: Ditto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr56284.diff
Type: application/octet-stream
Size: 2415 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130401/cb25906c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: altreturn_8.f90
Type: application/octet-stream
Size: 428 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130401/cb25906c/attachment-0001.obj>


More information about the Fortran mailing list