[cfe-commits] r167992 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/Analysis/additive-folding.cpp test/SemaCXX/compare.cpp

Eli Friedman eli.friedman at gmail.com
Wed Nov 14 16:08:45 PST 2012


On Wed, Nov 14, 2012 at 3:53 PM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> Richard,
>
> It brought new warnings in selfhosting.
>
> clang/lib/Sema/SemaExpr.cpp:8479:14: error:
>       comparison of constant -1 with expression of type 'BinOp::Opcode' (aka
>       'clang::BinaryOperatorKind') is always false
>       [-Werror,-Wtautological-constant-out-of-range-compare]
>   if (LHSopc == -1 && RHSopc == -1)
>       ~~~~~~ ^  ~~
> clang/lib/Sema/SemaExpr.cpp:8479:30: error:
>       comparison of constant -1 with expression of type 'BinOp::Opcode' (aka
>       'clang::BinaryOperatorKind') is always false
>       [-Werror,-Wtautological-constant-out-of-range-compare]
>   if (LHSopc == -1 && RHSopc == -1)
>                       ~~~~~~ ^  ~~
> 2 errors generated.

I think that falls into the category of constructs we should warn
about.  I'll fix it.

-Eli



More information about the cfe-commits mailing list