This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR63744 accept duplicate use-rename
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Mikael Morin <mikael dot morin at sfr dot fr>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 7 Feb 2015 13:41:36 +0100
- Subject: Re: [Patch, fortran] PR63744 accept duplicate use-rename
- Authentication-results: sourceware.org; auth=none
- References: <54D524BC dot 2090908 at sfr dot fr>
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