[cfe-dev] Visiting anonymous unions

Sergejs Belajevs sergejs.belajevs at gmail.com
Fri Aug 17 06:51:00 PDT 2012


Yes, it is valid C++ code. Clang gives errors if you try to process it
with .c extension, with .cpp all is OK on my machine.

On Fri, Aug 17, 2012 at 4:46 PM, Philip Craig <philipjcraig at gmail.com> wrote:
> On Fri, Aug 17, 2012 at 11:23 PM, Sergejs Belajevs
> <sergejs.belajevs at gmail.com> wrote:
>> but it doesn't work (VisitRecordType isn't get called) for code like:
>>
>> void foo()
>> {
>>   union { int a; };
>>   a = 5;
>> }
>
> Is that valid code? clang gives errors with the default options.



More information about the cfe-dev mailing list