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

Douglas Gregor dgregor at apple.com
Mon Jan 5 14:24:47 PST 2009


On Jan 5, 2009, at 5:22 PM, steve naroff wrote:

>
> 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).

And CXXTypeidExpr is another one of these. Unifying them would help  
clean things up.

	- Doug



More information about the cfe-dev mailing list