[cfe-commits] [PATCH] Sema: have BuildExpressionFromIntegralTemplateArgument produce well-formed IntegerLiterals

Peter Collingbourne peter at pcc.me.uk
Sat Nov 27 11:16:12 PST 2010


Hi Craig,

On Fri, Nov 26, 2010 at 03:02:12PM -0800, Craig Silverstein wrote:
> Either way, I'm not sure if the differences between these two patches
> are meaningful, and if so, which is 'more correct'.

It seems the only two differences are:

- getIntegerType() vs getPromotionType()
- CK_NoOp vs CK_IntegralCast

>From my understanding getIntegerType() is the machine representation
of the enum type while getPromotionType() is the type that enumerators
are promoted to.  Since we are substituting for an enumerator I think
getPromotionType() is correct.

CK_NoOp is used to add qualifiers so I don't think it's correct here,
whereas CK_IntegralCast is used to convert between integral types
(and is used to promote enumerators) so it seems to be more correct.

Thanks,
-- 
Peter



More information about the cfe-commits mailing list