Adjust locations for RECORD_TYPEs

Gabriel Dos Reis gdr@integrable-solutions.net
Thu Nov 26 00:13:00 GMT 2009


On Wed, Nov 25, 2009 at 5:41 PM, Taras Glek <tglek@mozilla.com> wrote:
> On 11/25/2009 03:36 PM, Gabriel Dos Reis wrote:
>>
>> On Wed, Nov 25, 2009 at 5:02 PM, Taras Glek<tglek@mozilla.com>  wrote:
>>
>>>
>>> On 11/25/2009 03:00 PM, Richard Guenther wrote:
>>>
>>>>
>>>> On Wed, Nov 25, 2009 at 11:57 PM, Taras Glek<tglek@mozilla.com>
>>>>  wrote:
>>>>
>>>>
>>>>>
>>>>> Hi,
>>>>> Currently locations for structs point at {, which is frustrating in
>>>>> error
>>>>> messages and painful if one uses GCC to index their codebase (ie
>>>>> http://australia.proximity.on.ca/dxr/)
>>>>>
>>>>> This patch attempts to correct that such that the location of a
>>>>> RECORD_TYPE
>>>>> will be the location of the class name.
>>>>>
>>>>>
>>>>
>>>> What will be the location for anonymous RECORD_TYPEs?
>>>>
>>>>
>>>
>>> End of struct/class token.
>>>
>>
>> Well, that looks weird to me, compared to the existing behaviour.
>>
>>
>
> Existing behavior is problematic for
> class foo
> : public parent
> {
> }
> programming style because any error messages/etc point to {, which often
> means that { is on top of the screen when you jump to that location, making
> one scroll up to get some context.

'{' is where the type definition is, and it is where it works well for
both named and unnamed user-defined type.

If your concern is for supporting a some coding standard, I think
that is should be the job of external tools, and all GCC has to do
is to emit enough location information -- so that anyone can
guide their IDE to support the favorite coding standards.

Consequently, I don't see this change as appropriate.

-- Gaby



More information about the Gcc-patches mailing list