This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, 4.5] PR 39414 - PROCEDURE statement double declaration bug
> In general, a repeated type declaration is legal, as long as it
> confirms the type.
err, ok ... you sure about that?
Then, how come that stuff like
integer :: i
integer :: i
end
is rejected by all compilers that I tried?
> We fixed this for intrinsic types when I first got
> involved with gfortran - it's in one of the Loren Meissner examples,
> if I recall correctly.
Hm, this name appears in the following test cases:
aliasing_dummy_1.f90
derived_pointer_recursion.f90
module_interface_1.f90
In none of them I can find any hint of what you're talking about.
However, in my patch I modified some code of yours in gfc_add_type,
which was committed as r114385, fixing PR16943, and allowing a double
declaration in code like this (as an *extension*):
integer function bugf(M) result (N)
integer, intent (in) :: M
integer :: N ! { dg-warning "already has basic type of INTEGER" }
N = M
return
end function bugf
(See func_decl_2.f90.)
So, ok. One *may* allow special cases like this, but I don't think
it's legal if you strictly follow the standard. Right?
Cheers,
Janus
> On Tue, Mar 10, 2009 at 4:41 PM, Janus Weil <janus@gcc.gnu.org> wrote:
>> Hi all,
>>
>> here is my fix for PR39414. It's regression-tested on
>> x86_64-unknown-linux-gnu. Ok for 4.5?
>>
>> Cheers,
>> Janus
>>
>>
>> 2009-03-10 ?Janus Weil ?<janus@gcc.gnu.org>
>>
>> ? ? ? ?PR fortran/39414
>> ? ? ? ?* decl.c (match_procedure_decl): Fix double declaration problems with
>> ? ? ? ?PROCEDURE statements.
>> ? ? ? ?* symbol.c (gfc_add_type): Ditto.
>>
>>
>> 2009-03-10 ?Janus Weil ?<janus@gcc.gnu.org>
>>
>> ? ? ? ?PR fortran/39414
>> ? ? ? ?* proc_decl_21.f90: New.
>>
>
>
>
> --
> The knack of flying is learning how to throw yourself at the ground and miss.
> ? ? ? --Hitchhikers Guide to the Galaxy
>