[cfe-commits] r59421 - /cfe/trunk/lib/AST/ExprConstant.cpp
Eli Friedman
eli.friedman at gmail.com
Sun Nov 16 13:33:15 PST 2008
On Sun, Nov 16, 2008 at 11:28 AM, Nuno Lopes <nunoplopes at sapo.pt> 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.
-Eli
More information about the cfe-commits
mailing list