[cfe-dev] Strange inconsistency between sizeof/typeof and type_of_type and type_of_expr.

steve naroff snaroff at apple.com
Mon Jan 5 14:22:11 PST 2009


On Jan 5, 2009, at 4:43 PM, Paolo Bolzoni wrote:

>
> dear clang-dev,
>
> I am seeing a strange inconsistency between sizeof/typeof as  
> expression and
> __typeof() as type.
>
> The former is programmed with a single class  
> clang::SizeOfAlignOfExpr with
> two bool functions isSizeOf() and isArgumentType() to distinguish  
> the four
> combinations.
>
> The latter is instead a pair of classes, clang::TypeOfType and
> clang::TypeOfExpr.
>
> Why this implementation difference?

No compelling reason.

>
> Wasn't easier implementing four classes also for the first case?

 From my perspective, it looks like a stylistic difference. The  
classes were written at different times by different people (I recall  
writing the TypeOfType/TypeOfExpr AST's).

>
> Like 'sizeof_expr, sizeof_type, typeof_expr, typeof_type.'
>

Unifying them is fine with me (if you'd like to pursue it).

snaroff

> pb
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list