[cfe-dev] Patch adding a Boolean flag to TagDecl nodes.

Douglas Gregor dgregor at apple.com
Wed Feb 3 12:42:46 PST 2010

On Jan 29, 2010, at 12:10 PM, Enea Zaffanella wrote:

> Hello.
> The attached patch adds a new Boolean flag to TagDecl nodes.
> The new flag, named IsDefinedInDeclarator, tells whether or not the
> TagDecl is a definition that was syntactically occurring (possibly via
> macro expansions) in a declarator. Examples include tag types defined in
> function return types, function parameter types, variable or field
> declarations and type arguments of cast or sizeof expressions.
> The new flag is meant to help clients such as code style checkers.

This feels like the wrong solution. I'd like to hear from others, but the best approach seems to be to extend TagTypeLoc with a bit that indicates whether this use of the tag type was a reference or a definition. That way, a pretty-printer could know exactly where to put the definition. 

	- Doug

More information about the cfe-dev mailing list