[cfe-dev] Start of source range for Decl nodes.

Stefan Seefeld stefan at seefeld.name
Fri Mar 4 08:36:15 PST 2011


On 2011-03-04 11:21, Douglas Gregor wrote:
> On Mar 4, 2011, at 8:06 AM, Stefan Seefeld wrote:
>
>> On 2011-03-04 10:30, Douglas Gregor wrote:
>>>
>>>    static struct Point { int x, y; } p1, *p2, get_point(int x, int y);
>>>
>>> Who claims the "static" keyword? Point? p1? Everyone?
>>>
>>>
> Nailing down what this actually means is fairly important for the discussion of representation. What's the source range for the entire declaration of "p2" in my example? Does it include the unrelated declarator p1? Does it include get_point?

Yes, I think it's best to stay close to the C++ grammar in that respect: 
The above contains a single (toplevel) declaration, with 4 (toplevel) 
declarators. There already is a VarDecl cursor for 'p2', whose extent is 
just the 'p2' token itself. The declaration this is part of then is the 
same for all four declarators, with the same extent, from 'static' to ';'.

Thanks,
         Stefan

-- 

       ...ich hab' noch einen Koffer in Berlin...




More information about the cfe-dev mailing list