[cfe-commits] [PATCH][MS][Review request] - Microsoft C anonymous struct, second try

Douglas Gregor dgregor at apple.com
Fri Nov 5 10:40:07 PDT 2010


On Nov 5, 2010, at 3:49 AM, Abramo Bagnara wrote:

> Il 05/11/2010 08:21, John McCall ha scritto:
> 
>> For top-level anonymous structs or unions, the first declaration in a NestedFieldDecl's chain would be a VarDecl;  otherwise it would be a FieldDecl.  In all cases, all the remaining decls would be FieldDecls.
> 
> It is not clear to me in which cases you get a VarDecl... isn't it
> always the FieldDecl of an anonymous variable?

The first declaration of the chain is the implicitly-generated variable or field for the outermost anonymous struct/union itself. For example, if I have:

	void f() {
		union {
			double real;
			int integer;
		};
	}

the anonymous union is represented by a VarDecl.

	- Doug





More information about the cfe-commits mailing list