[cfe-dev] Cleaning up the representation of Decls in the AST

Ted Kremenek kremenek at apple.com
Mon Aug 25 16:21:33 PDT 2008

On Aug 23, 2008, at 6:50 PM, Chris Lattner wrote:

>> This also works for typedefs:
>> typedef struct x {} foo, bar;
>> becomes a DeclGroup consisting of:
>> (1) A RecordDecl for 'struct x' (the "TypeDecl").
>> (2) Two TypedefDecls for 'foo' and 'bar'.
>> Note that this completely resolves the ownership issues with  
>> anonymous
>> structs and similar constructs.  It also means that Types no longer
>> own Decls (a good thing).
> Presumably this means that "typedef struct x foo, bar" would be a  
> DeclGroup with no "TypeDecl" but with two typedef decls?

The "TypeDecl" would be 'struct x'.

The DeclGroup would contain two TypedefDecls, one for the typedef of  
foo and the other for the typedef of bar.

More information about the cfe-dev mailing list