This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR fortran/56520 -- Special case unary minus/plus
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Jul 2015 19:06:03 -0700
- Subject: Re: [PATCH] PR fortran/56520 -- Special case unary minus/plus
- Authentication-results: sourceware.org; auth=none
- References: <20150701175304 dot GA88504 at troutmask dot apl dot washington dot edu>
On 07/01/2015 10:53 AM, Steve Kargl wrote:
> The attached patch special cases unary minus/plus when
> gfotran tries to match a function keyword in a mangled
> statement. The testcase contains examples, but for
> context consider 'c = exp(-a) )' where the final ')'
> is erronous. gfortran is trying to match a keyword
> such as 'c = exp(x=-a)' so it expects the character
> after the '(' to be in [a-z] or '_'. Prior to this
> patch, gfortran would do
>
> % gfc -c sd.f90
> sd.f90:8:13:
>
> c = exp(-a) ) ! dg-error { "Unclassifiable statement" }
> 1
> Error: Invalid character in name at (1)
>
> with the patch gfortran will instead issue
>
> % gfc -c sd.f90
> sd.f90:8:4:
>
> c = exp(-a) ) ! dg-error { "Unclassifiable statement" }
> 1
> Error: Unclassifiable statement at (1)
>
> It can be debated that the new error message isn't much better
> than old. I don't care to enter into such a debate, so will
> ignore comments complaining the new meesage isn't much of an
> improvement over the old.
>
> Regression tested on trunk. Ok to commit?
>
Yes OK. I agree we should not quibble over the error message as long as it is
not misleading.
Thanks,
Jerry