[cfe-dev] Tentative typeid Parser/AST implementation

Chris Lattner clattner at apple.com
Mon Nov 10 13:43:34 PST 2008


On Nov 9, 2008, at 8:00 AM, Sebastian Redl wrote:

> Hi,
>
> Attached patch implements parsing and AST support for typeid. It's  
> not complete in that the type of a typeid expression is const void  
> instead of const std::type_info, but otherwise everything should be  
> correct. However, since this is my first big change of the parser  
> and AST, I might well have overlooked something.

Hi Sebastian,

I have another question for you.  :)  In this node, you're taking the  
approach of handling exprs and types with the same AST node class.  In  
sizeof/alignof, we have different nodes for the expr/type case.

I agree with Doug that splitting up UnaryOperator (and friends) is  
goodness, but I'm not sure that having the node handle both expr and  
type subexpressions is a good approach.  What do you think?

-Chris



More information about the cfe-dev mailing list