From: Benjamin Kramer Date: Wed, 25 Aug 2010 13:24:04 +0000 (+0000) Subject: Silence a GCC warning saying that unsigned >= UO_PostInc is always true. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=993cdca0fed7deb646e4654dfb2607227a497faa;p=clang Silence a GCC warning saying that unsigned >= UO_PostInc is always true. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112048 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index e96a33f503..61159fdc4a 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -1080,10 +1080,10 @@ public: bool isPrefix() const { return isPrefix(getOpcode()); } bool isPostfix() const { return isPostfix(getOpcode()); } bool isIncrementOp() const { - return Opc == UO_PreInc || getOpcode() == UO_PostInc; + return Opc == UO_PreInc || Opc == UO_PostInc; } bool isIncrementDecrementOp() const { - return Opc >= UO_PostInc && Opc <= UO_PreDec; + return Opc <= UO_PreDec; } static bool isArithmeticOp(Opcode Op) { return Op >= UO_Plus && Op <= UO_LNot;