[cfe-dev] Access specifiers and anonymous unions

Abramo Bagnara abramo.bagnara at gmail.com
Thu Jun 3 23:27:34 PDT 2010


Il 01/06/2010 12:56, Abramo Bagnara ha scritto:
> Il 31/05/2010 20:42, John McCall ha scritto:
>>
>> On May 31, 2010, at 7:21 AM, Abramo Bagnara wrote:
>>
>>> Il 28/05/2010 19:53, John McCall ha scritto:
>>>>>
>>>>> To represent correctly the above we might decide to have a node for
>>>>> access specifiers at the same level of other decls.
>>>>
>>>> Yes, I've been wanting something like this for some time.
>>>
>>> Would it be OK if we derive from Decl a new class modeling syntactic
>>> access specifiers occurring in the list of member specifiers of a C++
>>> class definition?
>>>
>>> What about the name AccessSpecDecl ?
>>
>> Decl actually has a lot of space overhead, and if we put these in the decl chain
>> we have to instantiate them, etc.  If we want to be really space-conserving, we
>> could just add an array of little structs to CXXRecordDecl::DefinitionData.
>> On the other hand, that would make them much more difficult to use;  I'm torn.
>>
>>> Deriving from Decl already provides space for storing the access
>>> specifier (cannot be AS_none) and the corresponding source location.
>>> While at it, should we also provide a source location for the ':' ?
>>
>> Probably not necessary.
>>
>>> Am I right if I say that all code visiting CXXRecordDecl as a
>>> declaration context will automatically ignore this new class (which is
>>> actually a good thing)?
>>
>> Well, if they were Decls, lookup would ignore them because they wouldn't
>> be NamedDecls, but they'd still show up in the lexical decl chain.  That's
>> probably fine.
> 
> I've attached the patch that introduces AccessSpecDecl for your approval.
> 
> Of course it passes all tests.

Ping.

I apologize to annoy you, but we need to receive a bit of direction to
continue our work for clang. We have a other patchs waiting to be submitted.



More information about the cfe-dev mailing list