[cfe-dev] Visiting anonymous unions

Philip Craig philipjcraig at gmail.com
Fri Aug 17 17:18:48 PDT 2012


On Sat, Aug 18, 2012 at 6:28 AM, Manuel Klimek <klimek at google.com> wrote:
> On Fri, Aug 17, 2012 at 9:52 PM, John McCall <rjmccall at apple.com> wrote:
>> On Aug 17, 2012, at 6:23 AM, Sergejs Belajevs wrote:
>>> I am writing a source-to-source transformation tool and I need a way
>>> to check if function contains at least one anonymous union inside.
>>
>> You should see a DeclStmt that declares a single VarDecl whose type
>> is a RecordType whose RecordDecl has the isAnonymousStructOrUnion()
>> bit set.
>
> I have played around with that a bit - I have not found a RecordDecl
> within the FunctionDecl (but I have found a VarDecl) - if you say that
> should be there, that might be a problem with RAV...

I think John meant that the RecordDecl is only referenced via the
RecordType of the VarDecl. RAV currently doesn't traverse into the
RecordType though (same as in PR13618).



More information about the cfe-dev mailing list