2014-02-17 21:36 GMT+01:00 Tobias Burnus <bur...@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  <ja...@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  <ja...@gcc.gnu.org>
>>
>>      PR fortran/60231
>>      * gfortran.dg/typebound_generic_15.f90: New.
>
>
! { dg-do compile }
!
! PR 60231: [4.8/4.9 Regression] ICE on undefined generic
!
! Contributed by Antony Lewis <ant...@cosmologist.info>

module Objects

  Type TObjectList
  contains
    procedure :: Add1             ! { dg-error "must be a module procedure" }
    procedure :: Add2             ! { dg-error "must be a module procedure" }
    generic :: Add => Add1, Add2  ! { dg-error "are ambiguous" }
  end Type

end module

! { dg-final { cleanup-modules "Objects" } }

Reply via email to