[Patch, fortran] PR63744 accept duplicate use-rename

Paul Richard Thomas paul.richard.thomas@gmail.com
Sat Feb 7 12:41:00 GMT 2015


Dear Mikael,

It looks good to me for trunk and the branches.

Thanks for the patch

Paul

On 6 February 2015 at 21:31, Mikael Morin <mikael.morin@sfr.fr> wrote:
> Hello,
>
> we currently reject programs of the form
>>
>> module m
>>     integer :: s
>> end module m
>> subroutine s
>>     use m, only: x => s, x => s
>> end subroutine s
>
> with an error stating that S is the name of the current program unit.
> Interestingly, the duplicate rename is necessary to trigger it.
>
> There doesn't seem to be a consensus as to whether it should be
> accepted, but I think it should be.
> Quoting Dominique's comment in the PR:
>>  if
>>
>>   use m, only: A => X
>>   use m, only: B => X
>>
>> is valid, I don't see why
>>
>>   use m, only: A => X
>>   use m, only: A => X
>>
>> should not.
> The problem is we check the original (symbol) name instead of the local
> (symtree) name.
> The fix is close to obvious, and should be safe for the branches (this
> is a regression)
> Regression tested on x86_64-linux. OK for trunk/4.9/4.8 ?
>
> Mikael
>
>
>



-- 
Outside of a dog, a book is a man's best friend. Inside of a dog it's
too dark to read.

Groucho Marx



More information about the Gcc-patches mailing list