Adjust locations for RECORD_TYPEs

Taras Glek tglek@mozilla.com
Thu Nov 26 00:03:00 GMT 2009


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.

I don't see how this is better than going to either the class name or 
class tag in anonymous case.

Alternatively we could make the location reflect the beginning of the 
'class' token.

Taras



More information about the Gcc-patches mailing list