[Patch, Fortran, Regression] PR 60231: ICE on undefined generic

Janus Weil janus@gcc.gnu.org
Mon Feb 17 20:51:00 GMT 2014


2014-02-17 21:36 GMT+01:00 Tobias Burnus <burnus@net-b.de>:
> Janus Weil wrote:
>>
>> attached is a patch for an ICE-on-invalid problem with generics: We
>> simply don't check if any dummy args are present.
>
> There is something odd with your test case - and possibly with the patch.
> You state that this is an ICE-on-invalid problem; however, I do not see a
> dg-error in your test case.

Oh yes, sorry. I simply forgot the dg-errors. Thanks for noticing.
Updated test cases attached.

The errors one gets with the patch (as with 4.7) are the following:


typebound_generic_15.f90:13.21:

    generic :: Add => Add1, Add2  ! { dg-error "are ambiguous" }
                     1
Error: 'add1' and 'add2' for GENERIC 'add' at (1) are ambiguous
typebound_generic_15.f90:11.13:

    procedure :: Add1             ! { dg-error "must be a module procedure" }
             1
Error: 'add1' must be a module procedure or an external procedure with
an explicit interface at (1)
typebound_generic_15.f90:12.13:

    procedure :: Add2             ! { dg-error "must be a module procedure" }
             1
Error: 'add2' must be a module procedure or an external procedure with
an explicit interface at (1)


You think there's also something wrong with the patch?

Cheers,
Janus



>> Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.8?
>>
>> Cheers,
>> Janus
>>
>>
>> 2014-02-17  Janus Weil  <janus@gcc.gnu.org>
>>
>>      PR fortran/60231
>>      * resolve.c (check_generic_tbp_ambiguity): Check for presence of
>> dummy
>>      arguments to prevent ICE.
>>
>>
>> 2014-02-17  Janus Weil  <janus@gcc.gnu.org>
>>
>>      PR fortran/60231
>>      * gfortran.dg/typebound_generic_15.f90: New.
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typebound_generic_15.f90
Type: text/x-fortran
Size: 475 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140217/0221cb7d/attachment.bin>


More information about the Fortran mailing list