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

Paolo Bolzoni bolzoni at cs.unipr.it
Mon Jan 5 13:43:18 PST 2009


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?
Wasn't easier implementing four classes also for the first case?
Like 'sizeof_expr, sizeof_type, typeof_expr, typeof_type.'

pb



More information about the cfe-dev mailing list