[C++ Patch] Another bunch of location fixes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[C++ Patch] Another bunch of location fixes

Paolo Carlini-3
Hi,

nothing special here, various bits I missed so far or in the past meant
to test more thoroughly.

Thanks, Paolo.

//////////////////////////


CL_locs_47 (936 bytes) Download Attachment
patch_locs_47 (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [C++ Patch] Another bunch of location fixes

Jason Merrill
On 9/12/19 9:41 AM, Paolo Carlini wrote:
> +  if (!valid_array_size_p (dname
> +   ? declarator->id_loc : input_location,

Use the id_loc local variable?

OK with that change.

Jason

Reply | Threaded
Open this post in threaded view
|

Re: [C++ Patch] Another bunch of location fixes

Paolo Carlini-3
Hi,

On 15/09/19 16:22, Jason Merrill wrote:
> On 9/12/19 9:41 AM, Paolo Carlini wrote:
>> +      if (!valid_array_size_p (dname
>> +                   ? declarator->id_loc : input_location,
>
> Use the id_loc local variable?

This diagnostic is inside the loop over declarator->declarator.
Eventually, outside the loop, the id_loc local is updated to the final
declarator->id_loc or input_location. Norrmally in the loop we use the
current declarator->id_loc: what I tested seems more correct to me (we
have to account for input_location too because valid_array_size_p,
shared with the C front-end, wants a sound location)

Paolo.

Reply | Threaded
Open this post in threaded view
|

Re: [C++ Patch] Another bunch of location fixes

Jason Merrill
On Mon, Sep 16, 2019 at 5:22 AM Paolo Carlini <[hidden email]> wrote:

>
> On 15/09/19 16:22, Jason Merrill wrote:
> > On 9/12/19 9:41 AM, Paolo Carlini wrote:
> >> +      if (!valid_array_size_p (dname
> >> +                   ? declarator->id_loc : input_location,
> >
> > Use the id_loc local variable?
>
> This diagnostic is inside the loop over declarator->declarator.
> Eventually, outside the loop, the id_loc local is updated to the final
> declarator->id_loc or input_location. Norrmally in the loop we use the
> current declarator->id_loc: what I tested seems more correct to me (we
> have to account for input_location too because valid_array_size_p,
> shared with the C front-end, wants a sound location)

OK.

Jason