> On Sun, Nov 16, 2008 at 11:28 AM, Nuno Lopes <[EMAIL PROTECTED]> wrote:
>> Author: nlopes
>> Date: Sun Nov 16 13:28:31 2008
>> New Revision: 59421
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=59421&view=rev
>> Log:
>> make IntExprEvaluator fold the ?: operator
>
> Nice.
>
>> +bool IntExprEvaluator::VisitConditionalOperator(const 
>> ConditionalOperator *E) {
>> +  llvm::APSInt Cond(32);
>> +  if (!EvaluateInteger(E->getCond(), Cond, Info))
>> +    return false;
>
> This should really be using HandleConversionToBool; the condition
> isn't guaranteed to be an integer.

Thanks for reviewing. I've commited the fix and I confirm it fixes things 
like 'if (1.0 ? 1 : 0) { ...}'.
Nuno 

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to